UTF-8: Is glyph available lazarus / 31-LCL ---------------------------------------------------------------------- winni · 2019-10-20 13:14 Hi! Searched in a lot of code amd in the net, but no reply. Is there a function that tells me if a glyph for an UTF-8 codepoint in a Font is available? Something like Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function GlyphInFontAvailable (codepoint, fontname : string) : boolean; Example: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i if GlyphInFontAvailable('U+262E','Liberation sans') then .... Even if someone knows a more complicated way - the answer is welcome. Winni ---------------------------------------------------------------------- howardpc · 2019-10-20 15:31 I doubt that a reliable function of this sort could exist. LowerCase("fontname") does not point to a single unambiguous entity, even sometimes on a single OS, never mind across the plethora of possible systems. This is one reason many word processing file formats provide for embedding of specific fonts, to prevent the "wrong" font of the same name being used accidentally. Also font foundries extend their fonts from time to time, and continually introduce new ones such a function would not know about. I suspect you will have to trawl through the font data for the fonts you have available and discover this information, as it currently exists for the fonts you have access to, for yourself. ---------------------------------------------------------------------- Thaddy · 2019-10-20 15:43 Comes to mind: user schuler's excellent AI library would be able to recognize the drawn glyph based on machine learning! His library contains even an example how to implement such simple recognition! And it works... So you can draw that glyph and see if it matches a given reference picture. In that case it is supported. (This is doable! but complex) But that is another matter. I partially agree with Howard in this case. Such a function, a simple function relies on too many factors. But note my remark: can be done. ---------------------------------------------------------------------- lucamar · 2019-10-20 16:39 I don't know whether this is useful but you could probably build your own function using classes/functions from the FreeType units of package LazUtils, like EasyLazFreeType, etc. Drawback is that they are poorly documented if at all, though there are some examples in the Lazarus folder. ---------------------------------------------------------------------- winni · 2019-10-20 18:01 Thanx markov & thaddy! I hoped you gave me another answer but that's the situation. In windows there are some routines in the gdi*.dll, which are used by C++, Java and VBA. But that is win only. @lucamar: Hihihi . I'm sitting here and read the freetype sources. Ugly C-style Pascal. But thanx for the hint. ---------------------------------------------------------------------- sstvmaster · 2019-10-20 18:53 https://forum.lazarus.freepascal.org/index.php/topic,39102.msg267162.h tml see post from engkin. maybe that will help? ---------------------------------------------------------------------- winni · 2019-10-20 21:27 Yeah! Unknown treasures in the fpc sources. Thanx Winni