|
1 | 1 | use font_types::NameId;
|
2 | 2 | use fontspector_checkapi::{prelude::*, testfont, FileTypeConvert};
|
3 | 3 | use read_fonts::TableProvider;
|
4 |
| -use skrifa::MetadataProvider; |
5 | 4 |
|
6 | 5 | #[check(
|
7 | 6 | id = "opentype/name/empty_records",
|
@@ -64,39 +63,39 @@ should be removed (perhaps these were added by a longstanding FontLab Studio
|
64 | 63 | return_result(problems)
|
65 | 64 | }
|
66 | 65 |
|
67 |
| -#[check( |
68 |
| - id = "opentype/name/match_familyname_fullfont", |
69 |
| - rationale = r#" |
70 |
| - The FULL_FONT_NAME entry in the ‘name’ table should start with the same string |
71 |
| - as the Family Name (FONT_FAMILY_NAME, TYPOGRAPHIC_FAMILY_NAME or |
72 |
| - WWS_FAMILY_NAME). |
| 66 | +// #[check( |
| 67 | +// id = "opentype/name/match_familyname_fullfont", |
| 68 | +// rationale = r#" |
| 69 | +// The FULL_FONT_NAME entry in the ‘name’ table should start with the same string |
| 70 | +// as the Family Name (FONT_FAMILY_NAME, TYPOGRAPHIC_FAMILY_NAME or |
| 71 | +// WWS_FAMILY_NAME). |
73 | 72 |
|
74 |
| - If the Family Name is not included as the first part of the Full Font Name, and |
75 |
| - the user embeds the font in a document using a Microsoft Office app, the app |
76 |
| - will fail to render the font when it opens the document again. |
| 73 | +// If the Family Name is not included as the first part of the Full Font Name, and |
| 74 | +// the user embeds the font in a document using a Microsoft Office app, the app |
| 75 | +// will fail to render the font when it opens the document again. |
77 | 76 |
|
78 |
| - NOTE: Up until version 1.5, the OpenType spec included the following exception |
79 |
| - in the definition of Full Font Name: |
| 77 | +// NOTE: Up until version 1.5, the OpenType spec included the following exception |
| 78 | +// in the definition of Full Font Name: |
80 | 79 |
|
81 |
| - "An exception to the [above] definition of Full font name is for Microsoft |
82 |
| - platform strings for CFF OpenType fonts: in this case, the Full font name |
83 |
| - string must be identical to the PostScript FontName in the CFF Name INDEX." |
| 80 | +// "An exception to the [above] definition of Full font name is for Microsoft |
| 81 | +// platform strings for CFF OpenType fonts: in this case, the Full font name |
| 82 | +// string must be identical to the PostScript FontName in the CFF Name INDEX." |
84 | 83 |
|
85 |
| - https://docs.microsoft.com/en-us/typography/opentype/otspec150/name#name-ids |
86 |
| - "#, |
87 |
| - proposal = "https://github.com/fonttools/fontbakery/issues/4829", |
88 |
| - title = "Does full font name begin with the font family name?" |
89 |
| -)] |
90 |
| -fn check_name_match_familyname_fullfont(t: &Testable, _context: &Context) -> CheckFnResult { |
91 |
| - let font = testfont!(t); |
92 |
| - // We actually care about localization here, so don't just want |
93 |
| - // a vec of String. |
94 |
| - let full_names = font.font().localized_strings(NameId::FULL_NAME); |
95 |
| - let family_names = font.font().localized_strings(NameId::FAMILY_NAME); |
96 |
| - let typographic_names = font |
97 |
| - .font() |
98 |
| - .localized_strings(NameId::TYPOGRAPHIC_FAMILY_NAME); |
99 |
| - let wws_names = font.font().localized_strings(NameId::WWS_FAMILY_NAME); |
100 |
| - // if full_names.len() {} |
101 |
| - return_result(vec![]) |
102 |
| -} |
| 84 | +// https://docs.microsoft.com/en-us/typography/opentype/otspec150/name#name-ids |
| 85 | +// "#, |
| 86 | +// proposal = "https://github.com/fonttools/fontbakery/issues/4829", |
| 87 | +// title = "Does full font name begin with the font family name?" |
| 88 | +// )] |
| 89 | +// fn check_name_match_familyname_fullfont(t: &Testable, _context: &Context) -> CheckFnResult { |
| 90 | +// let font = testfont!(t); |
| 91 | +// // We actually care about localization here, so don't just want |
| 92 | +// // a vec of String. |
| 93 | +// let full_names = font.font().localized_strings(NameId::FULL_NAME); |
| 94 | +// let family_names = font.font().localized_strings(NameId::FAMILY_NAME); |
| 95 | +// let typographic_names = font |
| 96 | +// .font() |
| 97 | +// .localized_strings(NameId::TYPOGRAPHIC_FAMILY_NAME); |
| 98 | +// let wws_names = font.font().localized_strings(NameId::WWS_FAMILY_NAME); |
| 99 | +// // if full_names.len() {} |
| 100 | +// return_result(vec![]) |
| 101 | +// } |
0 commit comments