gofpdf
gofpdf copied to clipboard
Multiple Code Pages Possible?
Hi, I know UTF-8 is not supported, but I'm wondering if its possible to automatically support multiple code pages. For instance, I have my fonts using the cp1252.map mapping, but if I get russian characters they just get translate to periods. Would it be possible to also somehow include the russian mapping and switch between the mappings on the fly?
The ExampleFpdf_CellFormat_codepage()
example shows how multiple code pages can be included in one document.
Thanks, that helps. I can see the spot where it subs in a '.' character if it is not in the map.
https://github.com/jung-kurt/gofpdf/blob/cc7f4a2880e224dc55d15289863817df6d9f6893/util.go#L171
I guess I could make my own mapping function, so if the utf-8 code isn't found in the map, then it moves on to the next code page.
I guess I could make my own mapping function, so if the utf-8 code isn't found in the map, then it moves on to the next code page.
Super idea! Multiple code pages could be loaded either in sequence or in a single function using variadic arguments. During text output, a generalized translator would search the maps in order for the right code page. This would be a very useful enhancement to this library.
@scisci did you managed to solve this?
Unfortunately not.