Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix diacritic glyphs on Linux. #1868

Merged
merged 1 commit into from Oct 15, 2017
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Fix diacritic glyphs on Linux.

Diacritic glyphs have a valid width and height, but a
zero advance. Previously we were discarding these but
they are valid glyphs. The code also checks for a width
and height of 0 below, which catches non-printable glyphs
such as spaces.

Fixes #1846.
  • Loading branch information
gw3583 committed Oct 15, 2017
commit f5a23345e0a5421fff921dfbb896b61331d36784
@@ -278,12 +278,6 @@ impl FontContext {
) -> Option<GlyphDimensions> {
let metrics = unsafe { &(*slot).metrics };

// If there's no advance, no need to consider this glyph
// for layout.
if metrics.horiAdvance == 0 {
return None
}

let advance = metrics.horiAdvance as f32 / 64.0;
match unsafe { (*slot).format } {
FT_Glyph_Format::FT_GLYPH_FORMAT_BITMAP => {
@@ -0,0 +1,6 @@
root:
items:
- text: "x"
origin: 20 30
size: 20
font: "FreeSans.ttf"
@@ -0,0 +1,6 @@
root:
items:
- text: ""
origin: 20 30
size: 20
font: "FreeSans.ttf"
@@ -32,3 +32,4 @@ fuzzy(1,2) platform(linux) == colors.yaml colors-subpx.png
platform(linux) options(disable-subpixel) == border-radius.yaml border-radius-alpha.png
platform(linux) == border-radius.yaml border-radius-subpx.png
options(disable-aa) == transparent-no-aa.yaml transparent-no-aa-ref.yaml
!= diacritics.yaml diacritics-ref.yaml
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.