Closed AydinHassan closed 8 months ago
I believe this method returns a character code -> glyph table index mapping. The array index is the decimal value of the Unicode character. The array value is the index of the glyph in the glyph table.
But @PhenX can school both of us on this.
Take a look at their demo page, and go the glyph tab after loading a font. "You can find a demo GUI here."
This is the source code of that demo page: https://github.com/traitify/traitify-php/blob/master/vendor/phenx/php-font-lib/www/font_info.php https://github.com/traitify/traitify-php/blob/master/vendor/phenx/php-font-lib/www/js/glyph.js
Hi,
Full disclosure: I know nothing regarding fonts.
I am currently tasked with building some functionality which can render all of the glyphs in a font as an image. So basically just an image with a grid of glyphs.
I found this library and saw that I could extract all the glyphs from a given font. I assumed I would be able to pass a font, grab the glyphs and then render each glyph on an image. So I came up with the following code:
This seems to work, after hours of playing. But what I can't understand is the
getUnicodeCharMap()
function. For this particular font it returns something like:So the way I am currently using it is treating the keys as the unicode decimal value for the particular character.
Is this correct? If so: What is the value of each key?
For example. Lets pick element 2.
8 (the key) is the unicode decimal value What is 1 (the value) ?
Thanks and sorry for the n00b questions!