2

I am trying to use the Type 1 Computer Modern Roman (CMR) fonts with LibHaru but I am unable to display the characters from 0 to 31, even if the font is loaded successfully since I can display the ASCII characters in the resulting PDF file.

With GDI and Cairo, I have no problem displaying even a character with a value of 0 (null character), which corresponds to the Gamma character in most CMR fonts. In fact, Cairo's cairo_show_text() function can display a string containing only a null character. The function knows that the null character corresponds to a valid character instead of assuming that it's a null terminator.

Because cairo_show_text() requires a null-terminated string, if the string contains a null character, it can only display 1 character. GDI's TextOut(), however, is more flexible since it has a len parameter indicating the length of the string.

With LibHaru, HPDF_ShowText() and the like, the string must always be null terminated, so I have to modify the source code to accept a string containing only a null character. Unfortunately, the library does not display even the characters in the range 1 to 31.

Any help is appreciated. Thanks in advance.

0 Answers0