Skip to content
Prev 61875 / 63424 Next

proposal: 'dev.capabilities()' can also query Unicode capabilities of current graphics device

Hi

The problem is what "supports UNICODE" means.
Graphics devices have a 'hasTextUTF8' boolean to indicate that ...

     /* Some devices can plot UTF-8 text directly without converting
        to the native encoding, e.g. windows(), quartz() ....

        If this flag is true, all text *not in the symbol font* is sent
        in UTF8 to the textUTF8/strWidthUTF8 entry points.

... and this is TRUE for the pdf() device for example.
It is also TRUE for Cairo devices, but the support is quite different 
(as your examples demonstrate).
The Cairo devices do not alter UTF8 text at all, but the pdf() device 
attempts to convert to a single-byte representation, which of course 
will not always work.
The situation is only made more complex with the recent dev->glyph() 
support because that offers another possible route to producing generic 
UNICODE characters, including on pdf() devices.

Paul
On 21/09/23 04:12, Trevor Davis wrote: