forked from yeslogic/glyph-names
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dfaf4d1
commit d2898f5
Showing
15 changed files
with
553 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
/target | ||
gendata/*crashawk.awk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
BEGIN { | ||
FS=";" | ||
} | ||
|
||
/^[0-9A-Fa-z._]+;/ { maxglyphname=length($1) > maxglyphname ? length($1) : maxglyphname; } | ||
|
||
END { | ||
print maxglyphname | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# NOTE: This script must remain compatible with BSD awk and GNU awk | ||
|
||
BEGIN { | ||
FS=";" | ||
} | ||
|
||
# /^[0-9A-F]{4};/ should work but FreeBSD awk as of 12.1 doesn't support {} | ||
# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=54410 | ||
/^[0-9A-Za-z._-]+;[0-9A-F ]+/ { printf("%12c0x%s => Some(Cow::from(\"%s\")), %"(12+maxglyphname-length($1)-(length(substr($2, 4, -1))))"s%s\n", " ", substr($2, 0, 4), $1, "", "// "$3) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
//! ITC Zapf Dingbats Glyph List (2002) | ||
//! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
fn glyph_name_strict<'a>(c: char) -> Option<Cow<'a, str>> { | ||
match c as u32 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
_ => None, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@include "../gendata/join.awk" | ||
@include "../gendata/rust_arr_join.awk" | ||
# NOTE: This script must remain compatible with BSD awk and GNU awk | ||
|
||
BEGIN { | ||
FS=";" | ||
} | ||
|
||
# /^[0-9A-F]{4};/ should work but FreeBSD awk as of 12.1 doesn't support {} | ||
# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=54410 | ||
/^[0-9A-Za-z._-]+;[0-9A-F ]+/ { | ||
rust_arr_split_chars($2, hex); | ||
joined=rust_arr_join(hex); | ||
|
||
printf("%12c%s => Some(Cow::from(\"%s\")),\n", " ", arr, $1, "") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
fn glyph_name_vec<'a, S: AsRef<[char]>>(s: S) -> Option<Cow<'a, str>> { | ||
match s.as_ref().into_iter().map(|c|*c as u32).collect::<Vec<u32>>().as_slice() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
_ => None, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
impl<'a> GlyphNameStrict<'a> for ZapfDingbats { | ||
fn glyph_name_strict(c: char) -> Option<Cow<'a, str>> { | ||
self::glyph_name_strict(c) | ||
} | ||
} | ||
|
||
impl<'a> GlyphNameVec<'a> for ZapfDingbats { | ||
fn glyph_name_vec<'b, S: AsRef<[char]>>(s: S) -> Option<Cow<'a, str>> { | ||
self::glyph_name_vec(s) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pub struct ZapfDingbats; | ||
|
||
use std::borrow::Cow; | ||
use crate::traits::{GlyphNameStrict, GlyphNameVec}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
/// ITC Zapf Dingbats Glyph List (2002) | ||
/// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.