Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[subset] code points after 0 in --unicodes argument ignored #1361

Closed
blueshade7 opened this issue Nov 6, 2018 · 1 comment
Closed

[subset] code points after 0 in --unicodes argument ignored #1361

blueshade7 opened this issue Nov 6, 2018 · 1 comment

Comments

@blueshade7
Copy link
Contributor

It appears as if 0 is treated as a string null terminator.

% hb-subset --unicodes=41,42,0,43,44 --output-file=output.ttf Roboto-Regular.ttf
% spot -tcmap=5 output.ttf
--- encoding[0]
platformId=0
scriptId  =3
languageId=0
--- [code]=glyphId
[0041]=1 
[0042]=2 

--- encoding[1]
platformId=3
scriptId  =1
languageId=0
--- [code]=glyphId
[0041]=1 
[0042]=2 

--- encoding[2]
platformId=3
scriptId  =10
languageId=0
--- [code]=glyphId
[00000041]=1 
[00000042]=2 

In comparison, fontTools respects code points after 0.

% pyftsubset --unicodes=41,42,0,43,44 --output-file=output.ttf Roboto-Regular.ttf
% spot -tcmap=5 output.ttf
--- encoding[0]
platformId=0
scriptId  =3
languageId=0
--- [code]=glyphId
[0000]=1 
[0041]=2 
[0042]=3 
[0043]=4 
[0044]=5 

SNIP

@behdad
Copy link
Member

behdad commented Nov 6, 2018

It's a problem in how we represent text in utils/. I'll take a look.

@behdad behdad closed this as completed in 3ec2e4f Nov 6, 2018
ebraminio pushed a commit to ebraminio/harfbuzz that referenced this issue Nov 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants