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

Lib fails to read some ttf fonts #1

Open
gluck opened this issue Feb 25, 2022 · 0 comments
Open

Lib fails to read some ttf fonts #1

gluck opened this issue Feb 25, 2022 · 0 comments

Comments

@gluck
Copy link

gluck commented Feb 25, 2022

(which are then not accessible in FigmaLinux)

All msttcorefonts fail to be parsed in my environment:
(using font-reader/main.rs)

font-reader
Read '/usr/share/fonts/truetype/msttcorefonts/Arial.ttf' font error: Cannot read value of the head table param, id: 2, err: incomplete utf-8 byte sequence from index 8

While some other truetype fonts work properly:

font-reader
Font /usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf
Font count: 1
 family: DejaVu Serif
 id: DejaVu Serif
 style: Book
 postscript: DejaVuSerif
 weight: 400
 stretch: 5
 italic: false

Font files seem valid, and can be read using ttf-parser crate (using font-info example):

font-info /usr/share/fonts/truetype/msttcorefonts/Arial.ttf                      
Family name: Some("Arial")
PostScript name: Some("ArialMT")
Units per EM: 2048
Ascender: 1854
Descender: -434
Line gap: 67
Global bbox: Rect { x_min: -1361, y_min: -665, x_max: 4154, y_max: 2124 }
Number of glyphs: 1320
Underline: Some(LineMetrics { position: -217, thickness: 150 })
X height: None    
Weight: Normal
Width: Normal
Regular: true
Italic: false
Bold: false           
Oblique: false
Strikeout: Some(LineMetrics { position: 530, thickness: 102 })
Subscript: Some(ScriptMetrics { x_size: 1434, y_size: 1331, x_offset: 0, y_offset: 283 })
Superscript: Some(ScriptMetrics { x_size: 1434, y_size: 1331, x_offset: 0, y_offset: 977 })
Variable: false 
OpenType substitution:
  Scripts:  
    arab
      No languages
  Features:
    init        
    medi    
    fina    
    liga    
Elapsed: 693us
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant