lightmap Posted July 7, 2020 Share Posted July 7, 2020 Hello, Using search I'm found nothing, so im first with this problem. Very important to have special separate font, with special symbols, in text strings. Unigine have only setFont(string) for one font or i can put more font names in that string? any font fallback system? Link to comment
silent Posted July 7, 2020 Share Posted July 7, 2020 lightmap setFont() accept only a single font path. If you can describe your use-case in more details we can probably schedule some improvements in this area it the future releases. Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
lightmap Posted July 7, 2020 Author Share Posted July 7, 2020 Details is that, we recive string with text typed in word-like application, with using of some custom font file installed in windows/fonts the case is to correctly display same utf8 text in unigine any per-glyph font bake to texture is possible? Link to comment
silent Posted July 7, 2020 Share Posted July 7, 2020 So you can't use a regular font with UTF-8 support (maybe even purchased) like Arial UTF-8 or UNIFONT? In older SDK's versions there was a tool called imagettf to bake ttf fonts into a texture: https://developer.unigine.com/en/docs/2.8/tools/imagettf/ However, we only used it couple of times, so it may produce non-expected results. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
rohit.gonsalves Posted July 7, 2020 Share Posted July 7, 2020 1 hour ago, lightmap said: Details is that, we recive string with text typed in word-like application, with using of some custom font file installed in windows/fonts the case is to correctly display same utf8 text in unigine any per-glyph font bake to texture is possible? For exact need, I had written my own typography things which bakes things to texture. I have implemented it over Direct X on windows using Direct write and Direct 2D. With this approach all code page conversions for Unicode and joining of characters in scripts are handled nicely by Direct Write and Direct 2D. Probably you could do something on these lines. Regards, Rohit Link to comment
lightmap Posted July 7, 2020 Author Share Posted July 7, 2020 I tried to merge fonts custom+arial with fontlab/transtype/fontforge the problem with this is that custom glyps have places same as english glyphs and replace them - custom glyps rendered as intended but no english text - this is not the case if I make fonts merge by not replacing but adding new - this makes rendering custom glyphs as unidentified squares (seems they got new index) - and this is not the case too, as use imagettf typical case is having option to set fallback font, - if glyph not found then search in custom specified font rohit.gonsalves this seems good, but post does not contain any implementation details, seems writing own thing the way Link to comment
rohit.gonsalves Posted July 7, 2020 Share Posted July 7, 2020 Dear @lightmap, I have used DirectWrite and Direct2D for this implementation. Both API do font fallback. So you need not worry about it. https://docs.microsoft.com/en-us/windows/win32/directwrite/direct-write-portal https://docs.microsoft.com/en-us/windows/win32/direct2d/direct2d-portal and https://docs.microsoft.com/en-us/windows/win32/direct2d/direct2d-and-direct3d-interoperation-overview I had started with these API and later one of my friend suggested a good little tiny SDK for the same thing. Three API and you will have font rendered on DirectX texture or Unigine Texture. I ported my solution to this tiny API too. The API is https://github.com/gamelaster/FW1FontWrapper. I liked these API. Wonderful. In one day you should solve your Font issue. I actually took a week to write it using DirectWrite and Direct2D and my porting took just couple of hours with this API. Rohit. 1 Link to comment
Recommended Posts