font size and alignment adjustments

This commit is contained in:
Mike Dilger 2023-01-19 11:02:15 +13:00
parent c3b60b227a
commit 85ce60ac70
2 changed files with 15 additions and 9 deletions

View File

@ -137,18 +137,18 @@ pub fn textarea_highlighter(text: String) -> LayoutJob {
0.0,
match highlight {
HighlightType::Nothing => TextFormat {
font_id: FontId::new(14.0, FontFamily::Proportional),
font_id: FontId::new(12.0, FontFamily::Proportional),
color: Color32::BLACK,
..Default::default()
},
HighlightType::PublicKey => TextFormat {
font_id: FontId::new(16.0, FontFamily::Monospace),
font_id: FontId::new(12.0, FontFamily::Monospace),
background: Color32::LIGHT_GRAY,
color: Color32::DARK_GREEN,
..Default::default()
},
HighlightType::Event => TextFormat {
font_id: FontId::new(16.0, FontFamily::Monospace),
font_id: FontId::new(12.0, FontFamily::Monospace),
background: Color32::LIGHT_GRAY,
color: Color32::DARK_RED,
..Default::default()

View File

@ -110,7 +110,7 @@ pub(super) fn text_styles() -> BTreeMap<TextStyle, FontId> {
text_styles.insert(
TextStyle::Button,
FontId {
size: 13.5,
size: 13.0,
family: FontFamily::Proportional,
},
);
@ -118,7 +118,7 @@ pub(super) fn text_styles() -> BTreeMap<TextStyle, FontId> {
text_styles.insert(
TextStyle::Heading,
FontId {
size: 18.0,
size: 17.0,
family: FontFamily::Proportional,
},
);
@ -132,12 +132,18 @@ pub(super) fn font_definitions() -> FontDefinitions {
font_data.insert(
"DejaVuSans".to_owned(),
FontData::from_static(include_bytes!("../../fonts/DejaVuSans.ttf")),
FontData::from_static(include_bytes!("../../fonts/DejaVuSans.ttf"))
);
font_data.insert(
"Inconsolata".to_owned(),
FontData::from_static(include_bytes!("../../fonts/Inconsolata-Regular.ttf")),
FontData::from_static(include_bytes!("../../fonts/Inconsolata-Regular.ttf")).tweak(
FontTweak {
scale: 1.22, // This font is smaller than DejaVuSans
y_offset_factor: -0.21, // and too low
y_offset: 0.0,
},
),
);
// Some good looking emojis. Use as first priority:
@ -145,8 +151,8 @@ pub(super) fn font_definitions() -> FontDefinitions {
"NotoEmoji-Regular".to_owned(),
FontData::from_static(include_bytes!("../../fonts/NotoEmoji-Regular.ttf")).tweak(
FontTweak {
scale: 1.1, // make them a touch larger
y_offset_factor: -0.2, // move them up
scale: 1.1, // make them a touch larger
y_offset_factor: -0.26, // move them up
y_offset: 0.0,
},
),