ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  C++ BaseChart::addTitle() and smiley 😀
Posted by Stephan Bielmann on Jan-18-2023 22:47
Hello all,

we have ChartDirector version 6.0.0, Linux and Windows, and our application is in UTF-8. Users can set titles of the charts, this works fine for all kind of languages, e.g. as well for asian languages.

However when a user enters smileys, lets say 😀, no matter what font we make use of in the chart, e.g. Segoe UI Emoji on Windows, the smiley will never appear in the title, only a square like □

We have testFont() in use as well, however on Windows it will always report "No such file or directory [err code = 2]", even for fonts that exist and are correctly displayed.

Any help appreciated.

Stephan

  Re: C++ BaseChart::addTitle() and smiley 😀
Posted by Peter Kwan on Jan-19-2023 00:34
Attachments:
Hi Stephan,

ChartDirector only supports 16bit Unicode from U+0000 to U+FFFF. Traditionally, the smiley character is at U+263A, and this character is included in many traditional fonts (such as arial.ttf). You can see this character in the Windows Character Map (see attached image). This smiley character can be used with ChartDirector.

There is other smiley characters outside of the 16-bit Unicode range, such as U+1F60A. Unluckily, ChartDirector does not support these type of character. (I cannot even find it in Windows Character Map for the "SEGOE UI Emoji" font , even though it should exist.)

For the "testFont", note that in ChartDirector 6, the font is specified by using the font filename. For example, "Arial" is specified as "arial.ttf", "Arial Bold" is "arialbd.ttf", and "seguiemj.ttf". You can find the filename of a font by opening the "c:/Windows/Fonts" folder with the File Explorer, select the "Details" view, and make sure to include the "Font File Names" in the column heading. If you do not use the font filenames in your charting code, ChartDirector will not find the font. In this case, it will fallback to the default font "Arial", so the text can still be displayed.

ChartDirector 7 on Windows and macOS can use user friendly fontnames (in addition to the font filenames). However, on Linux, ChartDirector still needs to use font filenames.

Best Regards
Peter Kwan
charmap_smiley.png

  Re: C++ BaseChart::addTitle() and smiley 😀
Posted by Stephan Bielmann on Jan-19-2023 22:24
Hello Peter,

thank you very much, all clear now. Problem solved.