Skip to content

Commit

Permalink
Add hhea and vhea to OpenTypeFont
Browse files Browse the repository at this point in the history
  • Loading branch information
serenity4 committed Aug 25, 2024
1 parent 8801c75 commit deb38e0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/font.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ struct OpenTypeFont
cmap::CharacterToGlyphIndexMappingTable
hmtx::Optional{HorizontalMetrics}
vmtx::Optional{VerticalMetrics}
hhea::Optional{HorizontalHeader}
vhea::Optional{VerticalHeader}
end

Base.broadcastable(font::OpenTypeFont) = Ref(font)
Expand All @@ -34,7 +36,7 @@ function OpenTypeFont(data::OpenTypeData)
gsub = isnothing(data.gsub) ? nothing : GlyphSubstitution(data.gsub)
gpos = isnothing(data.gpos) ? nothing : GlyphPositioning(data.gpos)
gdef = isnothing(data.gdef) ? nothing : GlyphDefinition(data.gdef)
OpenTypeFont(datetime(head.created), datetime(head.modified), in(FONT_LAST_RESORT, head.flags), head.units_per_em, cmap_subtable_index, glyphs, gsub, gpos, gdef, data.cmap, data.hmtx, data.vmtx)
OpenTypeFont(datetime(head.created), datetime(head.modified), in(FONT_LAST_RESORT, head.flags), head.units_per_em, cmap_subtable_index, glyphs, gsub, gpos, gdef, data.cmap, data.hmtx, data.vmtx, data.hhea, data.vhea)
end

Base.getindex(font::OpenTypeFont, char::Char) = font[glyph_index(font, char)]
Expand Down

0 comments on commit deb38e0

Please sign in to comment.