freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] porting: Where should i start debugging


From: duhuanpeng
Subject: Re: [ft-devel] porting: Where should i start debugging
Date: Sat, 3 Mar 2018 20:31:28 +0800

Dear Werner,
First, thank you very much for your replying.

>* Your `dump_bitmap' version only produces crap for bitmap fonts (the
>  original function in the sample code doesn't work either, BTW – I've
>  just added a comment to `example1.c').  Reason is that you don't
>  check the buffer format of `slot->bitmap->pixel_mode', which is
>  FT_PIXEL_MODE_MONO in this case (meaning 8 pixels per byte).

Ah, I have change my code to below, take a look at
https://paste.ubuntu.com/p/9MxcP5czZt/
line 77, 97

The output still *not* correct:

          *--*^M
          |      OOOOO     |^M
          |  O  OOOOOO   O |^M
          | O   O    OO   O|^M
          |   O   OOO   O  |^M
          |OOO O O         |^M
          | OOOO      OO OO|^M
          |  OO OO        O|^M
          |  OOO OO       O|^M
          |                |^M
          |O     O        O|^M
          | OO   OO        |^M
          |                |^M
          |O  O OO        O|^M
          |   O            |^M
          |OO  O      OO OO|^M
          |                |^M
          *--*^M
See more (https://paste.ubuntu.com/p/NyXKB3CHd9/)

What is the FT_PIXEL_MODE_MONO bitmap format?
The output above is
Byte[0] Byte[1] (bit order 7-0)
Byte[3] byte[4]
Byte[5] byte[6]
...(more)...
Byte[30] Byte[31]

>* `FT_Load_Char' doesn't work for `gbst16.pcf' as expected.  Reason is
>  that this font is not encoded in Unicode (it is rather using GB2312
>  encoding), thus FreeType can't set up a cmap.  In this case,
>  `FT_Load_Char' behaves like `FT_Load_Glyph', this is, it handles the
>  input character codes as glyph indices.

>  You have to manually convert input character codes to glyph indices
>  (for example, using `iconv'), then using `FT_Load_Glyph'.
My input character is below, it is a interger. I guess at least, I guess
it will Show some character?
  for(ch=97; ch<65535; ch++) {
    ...
  }

By the way, my git repo is here, I am trying to make freetype compiled by keil:
https://gitee.com/m32/freetype2

Keil is quite popular IDE for MCU, hope you can give me some suggestion.

Regards,
duhuanpeng







reply via email to

[Prev in Thread] Current Thread [Next in Thread]