-
Notifications
You must be signed in to change notification settings - Fork 509
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
Incomplete handling of white space chars in HPDF_TextWidth and HPDF_TextRect #217
Comments
`/*
*/ #include "hpdf_conf.h" static HPDF_Font static HPDF_Font static HPDF_TextWidth static HPDF_UINT static char* static char * static HPDF_Dict static void static HPDF_STATUS /// ASP: Added function to check ASCII && UTF8 white spaces
} HPDF_Font
} static void
} static HPDF_Font
} static HPDF_Font
} static HPDF_STATUS
} static HPDF_TextWidth
} static HPDF_UINT
} static char*
} static char*
} static HPDF_Dict
} |
Could you make a pull request? This makes it way easier to see the changes. Please use the devel branch as base. |
Current HPDF_IS_WHITE_SPACE(c) macro handles ASCII white space characters, like \n\r\t. In some UTF8 texts, UTF8-specific whitespace characters are used. The example is:
"这是一个自由文本,有充分的一致性。这是具有“对齐”对齐方式的自由文本。这是一个自由文本,有充分的一致性。这是具有“对齐”对齐方式的自由文本。这是具有“对齐”对齐方式的自由文本。"
The character "。" is one of the UTF8 white space characters. When attempted to use the HPDF_TextRect function, the text above is considered as a single unbreakable line that doesn't fit the page width, and nothing is drawn. The attached version of the file uses the proposed HPDF_IS_WHITE_SPACE_UTF8(const char* ptr) function to handle this situation.
The proposed changes are marked with /// ASP
The text was updated successfully, but these errors were encountered: