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

PCF BdfEncodings code_point mapping error when code_point range < 0~255 #5400

Open
TakWolf opened this issue Apr 15, 2024 · 0 comments
Open

Comments

@TakWolf
Copy link

TakWolf commented Apr 15, 2024

Example font is: my-font.pcf.zip

This is only one glyph : 'A'

This is a rather extreme situation, will couse:

int16 min_char_or_byte2 = 65  
int16 max_char_or_byte2 = 65
int16 min_byte1 = 0
int16 max_byte1 = 0

At this time, code_point should be: for code_point in range(min_char_or_byte2, max_char_or_byte2 + 1):

But forgefont use:

for col in range(min_char_or_byte2, max_char_or_byte2 + 1):
    code_point = int.from_bytes(bytes([col, 0x00]))

This make code_point mapping to 0x4100
image

All single byte fonts will have this issue

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

1 participant