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

Support 'true' SFNT version #961

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions font-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,7 @@ pub const TTC_HEADER_TAG: Tag = Tag::new(b"ttcf");

/// The SFNT version for fonts containing TrueType outlines.
pub const TT_SFNT_VERSION: u32 = 0x00010000;
/// The SFNT version for legacy Apple fonts containing TrueType outlines.
pub const TRUE_SFNT_VERSION: u32 = 0x74727565;
/// The SFNT version for fonts containing CFF outlines.
pub const CFF_SFTN_VERSION: u32 = 0x4F54544F;
4 changes: 3 additions & 1 deletion read-fonts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,9 @@ impl<'a> FontRef<'a> {
data: FontData<'a>,
table_directory: TableDirectory<'a>,
) -> Result<Self, ReadError> {
if [TT_SFNT_VERSION, CFF_SFTN_VERSION].contains(&table_directory.sfnt_version()) {
if [TT_SFNT_VERSION, CFF_SFTN_VERSION, TRUE_SFNT_VERSION]
.contains(&table_directory.sfnt_version())
{
Ok(FontRef {
data,
table_directory,
Expand Down
Loading