|
From: | Parth Wazurkar |
Subject: | Re: [ft-devel] Updates for gf driver. |
Date: | Mon, 9 Jul 2018 12:27:05 +0530 |
[commit f7a27bf38847b4531164f042088535604d3cd2ec]
> I am attaching the example program I am using for checking output,
> its the same `example1.c' program but with some slight modifications
> to see the num_glyphs allocated.
Some comments.
* Your `ftexample.c' can't work correctly. In function `draw_bitmap'
there is the following comment:
/* for simplicity, we assume that `bitmap->pixel_mode' */
/* is `FT_PIXEL_MODE_GRAY' (i.e., not a bitmap font) */
Surprise, surprise! GF *is* a bitmap font, where
`bitmap->pixel_mode' is FT_PIXEL_MODE_MONO...
In other words, you have to adapt both `draw_bitmap' and
`show_image' to handle the mono format, having 1bit per pixel.
Honestly spoken, it's kind of disappointing that you completely
ignored this comment while modifying `ftexample.c'.
* Irrespective of that, there are big memory leaks. Calling
FT2_DEBUG=any:7 \
valgrind --leak-check=full \
./ftexample cmr10.600gf 0 \
2> ftexample.log
gives the attached log (using a `make devel; make' compilation).
* The next peculiarity is the size of the created bitmap. I'm not
sure what glyph gets displayed at index 48 (the charcode value of
`0' as used in the command above), but the height of the resulting
bitmap size, 4x7, looks far too small.
* Showing `bitmap' at begin of `draw_bitmap' with the debugger, I see
(gdb) p *bitmap
$1 = {
rows = 7,
width = 4,
pitch = 5,
buffer = 0x76f440 "",
num_grays = 0,
pixel_mode = 1 '\001',
palette_mode = 0 '\000',
palette = 0x0
}
which is also strange: A pitch of 5 implies at least a width of
4 * 8 + 1 = 33
pixels (since we have 8 pixels per byte). However, `width' has
value 4...
* If I display the 7 rows bit-wise, I get this:
0000000000000011111110000000000000000000
0000000000011111111111110000000000000000
0000000001111110000011111100000000000000
0000000011111000000000111110000000000000
0000001111100000000000001111100000000000
0000001111000000000000000111100000000000
0000011111000000000000000111110000000000
Whatever this is, it looks cut off.
Please fix these issues ASAP!
[Prev in Thread] | Current Thread | [Next in Thread] |