Skip to content

Commit ed79b11

Browse files
committed
Get wasm building
1 parent 6984523 commit ed79b11

File tree

4 files changed

+21
-14
lines changed

4 files changed

+21
-14
lines changed

profile-googlefonts/src/checks/googlefonts/font_copyright.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ use fontspector_checkapi::{prelude::*, FileTypeConvert};
22
use hashbrown::HashMap;
33
use skrifa::string::StringId;
44

5-
use crate::checks::googlefonts::metadata::family_proto;
6-
use crate::constants::EXPECTED_COPYRIGHT_PATTERN;
5+
use crate::{checks::googlefonts::metadata::family_proto, constants::EXPECTED_COPYRIGHT_PATTERN};
76

87
#[check(
98
id = "googlefonts/font_copyright",
@@ -71,7 +70,7 @@ fn font_copyright(c: &TestableCollection, context: &Context) -> CheckFnResult {
7170
.file_name()
7271
.and_then(|x| x.to_str())
7372
.unwrap_or_default();
74-
let filename = font.filename.as_os_str().to_str().unwrap_or_default();
73+
// let filename = font.filename.as_os_str().to_str().unwrap_or_default();
7574
let mut copyrights = vec![];
7675
font.get_name_entry_strings(StringId::COPYRIGHT_NOTICE)
7776
.for_each(|x| copyrights.push(("Name Table entry", x)));

profile-googlefonts/src/checks/googlefonts/metadata/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ mod protos {
2929
#![allow(clippy::all, clippy::unwrap_used)]
3030
include!(concat!(env!("OUT_DIR"), "/protos/mod.rs"));
3131
}
32+
#[allow(unused_imports)]
3233
pub(crate) use designers::DesignerInfoProto;
3334
pub(crate) use fonts_public::FamilyProto;
3435
use fontspector_checkapi::{CheckError, Testable};
@@ -51,5 +52,7 @@ mod consistent_repo_urls;
5152
pub use consistent_repo_urls::consistent_repo_urls;
5253
mod primary_script;
5354
pub use primary_script::primary_script;
55+
#[cfg(not(target_family = "wasm"))]
5456
mod designer_profiles;
57+
#[cfg(not(target_family = "wasm"))]
5558
pub use designer_profiles::designer_profiles;

profile-googlefonts/src/lib.rs

+15-11
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,21 @@ impl fontspector_checkapi::Plugin for GoogleFonts {
4848
.add_and_register_check(checks::googlefonts::metadata::category)
4949
// checks::googlefonts::metadata::category_hints // merged into metadata/validate
5050
.add_and_register_check(checks::googlefonts::metadata::consistent_repo_urls)
51-
.add_and_register_check(checks::googlefonts::metadata::consistent_with_fonts)
52-
// checks::googlefonts::metadata::filenames // merged into metadata/consistent_with_fonts
53-
// checks::googlefonts::metadata::canonical_style_names // merged into metadata/consistent_with_fonts
54-
// checks::googlefonts::metadata::valid_full_name_values // merged into metadata/consistent_with_fonts
55-
// checks::googlefonts::metadata::nameid/post_script_name // merged into metadata/consistent_with_fonts
56-
// checks::googlefonts::metadata::valid_post_script_name_values // merged into metadata/consistent_with_fonts
57-
// checks::googlefonts::metadata::nameid/family_and_full_names // merged into metadata/consistent_with_fonts
58-
// checks::googlefonts::metadata::valid_filename_values // redundant, see fontbakery#4997
59-
// checks::googlefonts::metadata::undeclared_fonts // redundant, see fontbakery#4997
60-
// checks::googlefonts::metadata::nameid/font_name // redundant, see fontbakery#4581
61-
.add_and_register_check(checks::googlefonts::metadata::designer_profiles)
51+
.add_and_register_check(checks::googlefonts::metadata::consistent_with_fonts);
52+
// checks::googlefonts::metadata::filenames // merged into metadata/consistent_with_fonts
53+
// checks::googlefonts::metadata::canonical_style_names // merged into metadata/consistent_with_fonts
54+
// checks::googlefonts::metadata::valid_full_name_values // merged into metadata/consistent_with_fonts
55+
// checks::googlefonts::metadata::nameid/post_script_name // merged into metadata/consistent_with_fonts
56+
// checks::googlefonts::metadata::valid_post_script_name_values // merged into metadata/consistent_with_fonts
57+
// checks::googlefonts::metadata::nameid/family_and_full_names // merged into metadata/consistent_with_fonts
58+
// checks::googlefonts::metadata::valid_filename_values // redundant, see fontbakery#4997
59+
// checks::googlefonts::metadata::undeclared_fonts // redundant, see fontbakery#4997
60+
// checks::googlefonts::metadata::nameid/font_name // redundant, see fontbakery#4581
61+
#[cfg(not(target_family = "wasm"))]
62+
let builder =
63+
builder.add_and_register_check(checks::googlefonts::metadata::designer_profiles);
64+
65+
let builder = builder
6266
.add_and_register_check(checks::googlefonts::metadata::escaped_strings)
6367
// .add_and_register_check(checks::googlefonts::metadata::family_directory_name)
6468
.add_and_register_check(checks::googlefonts::metadata::familyname)

profile-googlefonts/src/network_conditions.rs

+1
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ pub(crate) fn get_url(
181181
request.send().and_then(|r| r.error_for_status())
182182
}
183183

184+
#[allow(dead_code)]
184185
pub const DESIGNER_INFO_RAW_URL: &str =
185186
"https://raw.githubusercontent.com/google/fonts/master/catalog/designers/";
186187

0 commit comments

Comments
 (0)