Skip to content

Instantly share code, notes, and snippets.

@audreyt
Created July 19, 2014 16:20
Show Gist options
  • Select an option

  • Save audreyt/35838f253aa0a5e1059f to your computer and use it in GitHub Desktop.

Select an option

Save audreyt/35838f253aa0a5e1059f to your computer and use it in GitHub Desktop.
SourceHanSansTWHK-Normal subsetting example
#!/usr/bin/env PYTHONHOME=/Applications/FontForge.app/Contents/Resources/opt/local/bin/Python.framework.2.7 DISPLAY=:0 /Applications/FontForge.app/Contents/Resources/opt/local/bin/fontforge -script
Open("/Users/audreyt/Downloads/SourceHanSansTWHK-1.000/SourceHanSansTWHK-Normal.otf")
Select(0u3000)
SelectMore(0u3001)
SelectMore(0u3002)
SelectInvert()
Clear()
Generate("SourceHanSansTWHK-Normal-Subset.ttf")
@audreyt

audreyt commented Jul 19, 2014

Copy link
Copy Markdown
Author

把要取出的字每列寫成一個 SelectMore() 即可。例如:

my %seen; while (<>) { chomp; $seen{$_}++ for split //; }
for my $char (sort keys %seen) { printf "SelectMore(0u%04x)\n", ord $char; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment