Umnik Posted February 26, 2010 Share Posted February 26, 2010 I make cyrillic fonts in Font Studio. I used the instruction: http://www.leadwerks.com/wiki/index.php?title=LoadFont As a result, I do not see not a single letter in the text. Using SetBlend (1) the text disappears completely. SetFont(LoadFont("abstract::cyrrilic")); ... ... DrawText(0,100,"Test Cyrrilic: Привет медвед!"); my font file: http://dev.ramgames.ru/temp/font.rar Quote Windows 7 Ultimate x64bit / Intel Core 2 Quad Q8400 / 4GB DDR2 SDRAM / GeForce 8800 GTS Resource War Developer [ dev blog ] Link to comment Share on other sites More sharing options...
macklebee Posted February 26, 2010 Share Posted February 26, 2010 attach your font so we can see whats wrong with it... what Font are you using? Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Umnik Posted February 26, 2010 Author Share Posted February 26, 2010 attach your font so we can see whats wrong with it... what Font are you using? my font file: http://dev.ramgames.ru/temp/font.rar i use @Arial Unicode MS 10px Quote Windows 7 Ultimate x64bit / Intel Core 2 Quad Q8400 / 4GB DDR2 SDRAM / GeForce 8800 GTS Resource War Developer [ dev blog ] Link to comment Share on other sites More sharing options...
macklebee Posted February 26, 2010 Share Posted February 26, 2010 i would assume this is your problem: IMPORTANT: You may however only select characters up to index 255 (the 'ÿ'), because Leadwerks Engine doesn't support Unicode at this point. Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Umnik Posted February 26, 2010 Author Share Posted February 26, 2010 i would assume this is your problem: But up to 255 characters there is not one letter of Russian alphabet. How can I be? Quote Windows 7 Ultimate x64bit / Intel Core 2 Quad Q8400 / 4GB DDR2 SDRAM / GeForce 8800 GTS Resource War Developer [ dev blog ] Link to comment Share on other sites More sharing options...
Umnik Posted February 26, 2010 Author Share Posted February 26, 2010 i find bug. in INI file. Error variant: [FontData] 0Char=32 0A=0 0C=3 0Wid=9 0Hgt=22 0X1=0,0078125 0Y1=0,00390625 0X2=0,04296875 0Y2=0,046875 1Char=33 worked variant: [FontData] 0Char=32 0A=0 0C=3 0Wid=9 0Hgt=22 0X1=0.0078125 0Y1=0.00390625 0X2=0.04296875 0Y2=0.046875 1Char=33 need , replace . Quote Windows 7 Ultimate x64bit / Intel Core 2 Quad Q8400 / 4GB DDR2 SDRAM / GeForce 8800 GTS Resource War Developer [ dev blog ] Link to comment Share on other sites More sharing options...
macklebee Posted February 26, 2010 Share Posted February 26, 2010 cool... so did that fix your issue? Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Umnik Posted February 27, 2010 Author Share Posted February 27, 2010 cool... so did that fix your issue? yeah. But my problem is never decided! Here is my new problem: Quote Windows 7 Ultimate x64bit / Intel Core 2 Quad Q8400 / 4GB DDR2 SDRAM / GeForce 8800 GTS Resource War Developer [ dev blog ] Link to comment Share on other sites More sharing options...
Masterxilo Posted February 27, 2010 Share Posted February 27, 2010 Now this is caused by the no-unicode-support. As you said: up to 255 characters there is not one letter of Russian alphabet. Your first problem was a windows <-> leadwerks engine problem, because windows writes a "." but in some regions a "," as decimal place separator in ini files. That would be no problem if only the windows functions would be used for saving and loading ini files, instead of a custom parser... (though using files from regions different than yours might also cause problems for the windows functions, not sure) Quote Hurricane-Eye Entertainment - Site, blog. Link to comment Share on other sites More sharing options...
Umnik Posted February 27, 2010 Author Share Posted February 27, 2010 Who has any have any thoughts on this matter? Quote Windows 7 Ultimate x64bit / Intel Core 2 Quad Q8400 / 4GB DDR2 SDRAM / GeForce 8800 GTS Resource War Developer [ dev blog ] Link to comment Share on other sites More sharing options...
Masterxilo Posted February 27, 2010 Share Posted February 27, 2010 http://leadwerks.com/werkspace/index.php?/topic/1173-unicode/ Quote Hurricane-Eye Entertainment - Site, blog. Link to comment Share on other sites More sharing options...
Canardia Posted February 27, 2010 Share Posted February 27, 2010 No need for unicode for cyrillic. Font Studio uses 16-bit values for cyrillic letters, so all you have to do is to write a tool to shift the >255 letters into the byte range: 94Char=12694A=1 94C=9 94Wid=11 94Hgt=22 94X1=0.28125 94Y1=0.171875 94X2=0.32421875 94Y2=0.2578125 95Char=1025 95A=1 95C=9 95Wid=11 95Hgt=22 95X1=0.32421875 95Y1=0.171875 95X2=0.3671875 95Y2=0.2578125 I'm writing such a tool now Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Canardia Posted February 27, 2010 Share Posted February 27, 2010 Cyrillic letters work in LE! Here is demo program: #include "engine.h" typedef unsigned short int wrd; typedef unsigned char chr; typedef signed char byt; typedef unsigned short int * str16; int str16len(wchar_t *s) { int i=0; while(1) { if( s[i]==0 && s[i+1]==0 ) return i/2; i+=2; if( i>511 ) return 0; } } str str16to8(wchar_t *s) { int n=str16len(s); char *t=new char[n+1]; t[n]=0; for(int i=0;i<n;i++) { wrd c=(wrd)s[i]; if(c>255)c-=1025+128; t[i]=(byt)c; } return t; } int main() { wchar_t *s=L"Test Cyrillic: Привет медвед!"; printf("****%s****\n",str16to8(s)); Initialize(); RegisterAbstractPath("c:/program files/leadwerks engine sdk"); Graphics(); CreateFramework(); SetFont(LoadFont("abstract::cyrillic")); while(!KeyHit()) { UpdateFramework(); RenderFramework(); SetBlend(BLEND_ALPHA); DrawText(1,100,str16to8(s)); SetBlend(BLEND_NONE); Flip(0); } Terminate(); } And the result: Note that you can have well 2 different language fonts at the same time, and also more since you only need to switch the font in realtime (no FPS cost): And here is the tool to convert Font Studio ini files from 16 to 8 bit: fontstudioini16to8.zip 1 Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Umnik Posted February 27, 2010 Author Share Posted February 27, 2010 Thank you very much, you as always excellent, everything works! Quote Windows 7 Ultimate x64bit / Intel Core 2 Quad Q8400 / 4GB DDR2 SDRAM / GeForce 8800 GTS Resource War Developer [ dev blog ] Link to comment Share on other sites More sharing options...
Canardia Posted February 27, 2010 Share Posted February 27, 2010 I noticed that Font Studio doesn't fill the char values very tight, so sometimes there are jumps in the series. I will write a more advanced tool and corresponding demo to maximize out the number of characters you can have in the byte range. Right now there are even some of the cyrillic letters missing, because they jump over 255 at the end, although there would be enough space to fit them all in (213 characters used). Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Canardia Posted February 28, 2010 Share Posted February 28, 2010 Final version is ready, now it supports the following features: Automatic optimization of full byte range for unicode characters ASCII letter range unchanged, so that the Font Studio font works also with normal 8-byte text Drag and drop support: simply drag the Font Studio ini file over the fontstudioini16to8.exe and it creates the index (.idx) and new ini file (.ini.new) which you can then safely rename Conversion of country specific decimal signs to global standard format ("," -> ".") Works with any project which uses Font Studio fonts, not only LE projects. Price 9€ includes full source code of converter and C/C++ header files for the runtime fontstudioini16to8 1.0 © 2010 Siipi (http://www.siipi.com) Usage: fontstudioini16to8 <input.ini> <output.ini> Converts Font Studio ini files from 16-bit to 8-bit, so that Cyrillic, Arabic, etc... characters can be used without unicode support. C:\home\username>fontstudioini16to8.exe cyrillic.ini fontstudioini16to8 1.0 © 2010 Siipi (http://www.siipi.com) Reading from input file cyrillic.ini Creating output file cyrillic.ini.new Creating index file cyrillic.idx Indexed 213 characters. Space remaining for 42 additional characters. Demo: #include "engine.h" #include "fs16to8.h" int main() { TFontIndex cyridx=LoadFontIndex("cyrillic.idx"); TFontIndex araidx=LoadFontIndex("arabic_arial_19.idx"); wchar_t *s1=L"Test Cyrillic: Привет медвед!"; wchar_t *s2=_wcsrev(_wcsdup(L"السلام عليكم :CIBARA TSET")); Initialize(); RegisterAbstractPath("c:/program files/leadwerks engine sdk"); Graphics(); CreateFramework(); TFont cyrfnt=LoadFont("abstract::cyrillic"); TFont arafnt=LoadFont("abstract::arabic_arial_19"); while(!KeyHit()) { UpdateFramework(); RenderFramework(); SetBlend(BLEND_ALPHA); SetFontIndex(cyridx); SetFont(cyrfnt); DrawText(1,50,str16to8(s1)); SetFontIndex(araidx); SetFont(arafnt); DrawText(1,70,str16to8(s2)); SetFont(cyrfnt); SetBlend(BLEND_NONE); Flip(0); } Terminate(); } Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.