olikraus / u8g2

U8glib library for monochrome displays, version 2
Other
5.19k stars 1.06k forks source link

convert Arabic fonts( Unicode UTF-8 ) not work !! #2527

Open X960xx opened 1 month ago

X960xx commented 1 month ago

hello olikraus

I tried many times to convert Arabic fonts to work in my project, but I did not succeed. I do not know what the reason is ?

from ttf to BDF otf2bdf -r 72 -p 24 segoeui.ttf -o segoeui.bdf

from BDF to C file bdfconv -f 1 -m '32-255' -n segoeui-o segoeui.c segoeui.bdf bdfconv -v 0 -f 1 -m'32-128,$600-$06FF,$FB50-$FBB1,$FE70-$FEFF' -n u8g2_font_segoeui -o u8g2_font_segoeui.c segoeui.bdf bdfconv -b 0 -f 1 -m map/gb2312.map -n u8g2_font_segoeui -o u8g2_font_segoeui.c segoeui.bdf

Any help ?

thank you

olikraus commented 1 month ago

Which command doesn't work? Basically you need a blank between the option and its arguments. Also the map file requires an uppercase -M

bdfconv [options] filename -h Display this help -v Print log messages -b Font build mode, 0: proportional, 1: common height, 2: monospace, 3: multiple of 8, 4: 5x7 mode -f Font format, 0: ucglib font, 1: u8g2 font, 2: u8g2 uncompressed 8x8 font (enforces -b 3) -m 'map' Unicode ASCII mapping -M 'mapfile' Read Unicode ASCII mapping from file 'mapname' -o C output font file -k C output file with kerning information -p <%> Minimum distance for kerning in percent of the global char width (lower values: Smaller gaps, more data) -x X-Offset for 8x8 font sub-glyph extraction (requires -f 2, default 0) -y Y-Offset for 8x8 font sub-glyph extraction (requires -f 2, default 0) -th Horizontal size of the 8x8 glyphs (requires -f 2, default 1) -tv Vertical size of the 8x8 glyphs (requires -f 2, default 1) -n C indentifier (font name) -d Overview picture: Enable generation of bdf.tga and assign BDF font for description -l Overview picture: Set left margin -g Overview picture: Set glyphs per line (default: 16) -a Overview picture: Additional font information (background, orange&blue dot) -t Overview picture: Test string (Woven silk pyjamas exchanged for blue quartz.) -r Runtime test

X960xx commented 4 weeks ago

HELLO OLIVER

ALL commandS IN THIS SITE NOT WORK WITH ME

I USEd command FROM THIS WEBSITE u8g2 Unifont helper https://stncrn.github.io/u8g2-unifont-helper I USED THIS commands AND IT'S WORKING

TTF > BDF otf2bdf -r 72 -p 32 Hacen.ttf -o myfont.bdf

BDF > C FILE bdfconv -v -f 1 -m "32-65276" myfont.bdf -o u8g2_font_myfont.c -n u8g2_font_myfont -d myfont.bdf

I noticed most Arabic fonts maps start from 32 and end at 65276

thank you

olikraus commented 3 weeks ago

I am happy to see that your problem was solved with the help of an external web site.