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.
[glyphlist.txt] Add support for glyphlist.txt
- Loading branch information
1 parent
3fb4c86
commit bfc76c0
Showing
6 changed files
with
4,384 additions
and
0 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 |
---|---|---|
@@ -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($2)"s%s\n", " ", $2, $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,9 @@ | ||
_ => None, | ||
} | ||
} | ||
|
||
impl<'a> GlyphNameOpt<'a> for LegacyAdobeGlyphList { | ||
fn glyph_name_opt(c: char) -> Option<Cow<'a, str>> { | ||
self::glyph_name_opt(c) | ||
} | ||
} |
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,7 @@ | ||
pub struct LegacyAdobeGlyphList; | ||
|
||
use std::borrow::Cow; | ||
use super::GlyphNameOpt; | ||
|
||
fn glyph_name_opt<'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,9 @@ | ||
BEGIN { | ||
FS=";" | ||
} | ||
|
||
/^[0-9A-Fa-z._]+;/ { maxglyphname=length($1) > maxglyphname ? length($1) : maxglyphname; } | ||
|
||
END { | ||
print maxglyphname | ||
} |
Oops, something went wrong.