Skip to content

Lib fails to read some ttf fonts #1

@gluck

Description

@gluck

(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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions