|
1 |
| -use std::collections::HashSet; |
| 1 | +// use std::collections::HashSet; |
2 | 2 |
|
3 |
| -use fontspector_checkapi::{return_result, Check, FontCollection, Status, StatusCode, StatusList}; |
4 |
| -use read_fonts::tables::os2::SelectionFlags; |
5 |
| -use skrifa::string::StringId; |
| 3 | +// use fontspector_checkapi::{return_result, Check, FontCollection, Status, StatusCode, StatusList}; |
| 4 | +// use read_fonts::tables::os2::SelectionFlags; |
| 5 | +// use skrifa::string::StringId; |
6 | 6 |
|
7 |
| -fn bold_italic_unique(c: &FontCollection) -> StatusList { |
8 |
| - let ribbi = c.ribbi_fonts(); |
9 |
| - let mut problems = vec![]; |
10 |
| - let mut flags: HashSet<(bool, bool)> = HashSet::new(); |
11 |
| - for font in ribbi.iter() { |
12 |
| - let _names_list = font.get_name_entry_strings(StringId::FAMILY_NAME); |
13 |
| - match font.get_os2_fsselection() { |
14 |
| - Ok(fsselection) => { |
15 |
| - let val = ( |
16 |
| - fsselection.intersects(SelectionFlags::BOLD), |
17 |
| - fsselection.intersects(SelectionFlags::ITALIC), |
18 |
| - ); |
19 |
| - if flags.contains(&val) { |
20 |
| - problems.push(Status { |
21 |
| - message: Some(format!( |
22 |
| - "Font {} has the same selection flags ({}{}{}) as another font", |
23 |
| - font.filename, |
24 |
| - if val.0 { "bold" } else { "" }, |
25 |
| - if val.0 && val.1 { " & " } else { "" }, |
26 |
| - if val.1 { "italic" } else { "" } |
27 |
| - )), |
28 |
| - code: StatusCode::Error, |
29 |
| - }); |
30 |
| - } else { |
31 |
| - flags.insert(val); |
32 |
| - } |
33 |
| - } |
34 |
| - Err(_e) => problems.push(Status { |
35 |
| - message: Some(format!("Font {} had no OS2 table", font.filename)), |
36 |
| - code: StatusCode::Error, |
37 |
| - }), |
38 |
| - } |
39 |
| - } |
40 |
| - return_result(problems) |
41 |
| -} |
42 |
| -pub const BOLD_ITALIC_UNIQUE_CHECK: Check = Check { |
43 |
| - id: "com.adobe.fonts/check/family/bold_italic_unique_for_nameid1", |
44 |
| - title: "Check that OS/2.fsSelection bold & italic settings are unique for each NameID1", |
45 |
| - rationale: None, |
46 |
| - proposal: Some("https://github.com/googlefonts/fontbakery/pull/2388"), |
47 |
| - check_all: Some(&bold_italic_unique), |
48 |
| - check_one: None, |
49 |
| -}; |
| 7 | +// fn bold_italic_unique(c: &FontCollection) -> StatusList { |
| 8 | +// let ribbi = c.ribbi_fonts(); |
| 9 | +// let mut problems = vec![]; |
| 10 | +// let mut flags: HashSet<(bool, bool)> = HashSet::new(); |
| 11 | +// for font in ribbi.iter() { |
| 12 | +// let _names_list = font.get_name_entry_strings(StringId::FAMILY_NAME); |
| 13 | +// match font.get_os2_fsselection() { |
| 14 | +// Ok(fsselection) => { |
| 15 | +// let val = ( |
| 16 | +// fsselection.intersects(SelectionFlags::BOLD), |
| 17 | +// fsselection.intersects(SelectionFlags::ITALIC), |
| 18 | +// ); |
| 19 | +// if flags.contains(&val) { |
| 20 | +// problems.push(Status { |
| 21 | +// message: Some(format!( |
| 22 | +// "Font {} has the same selection flags ({}{}{}) as another font", |
| 23 | +// font.filename, |
| 24 | +// if val.0 { "bold" } else { "" }, |
| 25 | +// if val.0 && val.1 { " & " } else { "" }, |
| 26 | +// if val.1 { "italic" } else { "" } |
| 27 | +// )), |
| 28 | +// code: StatusCode::Error, |
| 29 | +// }); |
| 30 | +// } else { |
| 31 | +// flags.insert(val); |
| 32 | +// } |
| 33 | +// } |
| 34 | +// Err(_e) => problems.push(Status { |
| 35 | +// message: Some(format!("Font {} had no OS2 table", font.filename)), |
| 36 | +// code: StatusCode::Error, |
| 37 | +// }), |
| 38 | +// } |
| 39 | +// } |
| 40 | +// return_result(problems) |
| 41 | +// } |
| 42 | +// pub const BOLD_ITALIC_UNIQUE_CHECK: Check = Check { |
| 43 | +// id: "com.adobe.fonts/check/family/bold_italic_unique_for_nameid1", |
| 44 | +// title: "Check that OS/2.fsSelection bold & italic settings are unique for each NameID1", |
| 45 | +// rationale: None, |
| 46 | +// proposal: Some("https://github.com/googlefonts/fontbakery/pull/2388"), |
| 47 | +// check_all: Some(&bold_italic_unique), |
| 48 | +// check_one: None, |
| 49 | +// }; |
0 commit comments