[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ft-devel] rendering differences between OS X and Win32
From: |
Kevin Barabash |
Subject: |
[ft-devel] rendering differences between OS X and Win32 |
Date: |
Mon, 26 Dec 2005 03:29:22 -0700 |
I'm try to write a cross platform application and I'd like there to be
uniform behaviour when it comes to rendering fonts. Unfortunately I
ran into a bug and just to make sure that there wasn't a problem with
my code I wrote a short test program to highlight the bug. Here's a
list of the program and the output for both OS X and Win32.
program:
#include <stdio.h>
#include <ft2build.h>
#include FT_FREETYPE_H
int main(void) {
FT_Library library;
FT_Init_FreeType(&library);
FT_Face face;
FT_New_Face(library, "arial.ttf", 0, &face);
FT_Set_Char_Size(face, 0, (18 << 6), 72, 72);
unsigned i;
for (i = 65; i < 90; i++) {
FT_Load_Char(face, i, FT_LOAD_RENDER | FT_LOAD_NO_AUTOHINT);
FT_GlyphSlot glyph = face->glyph;
printf("rows: %d width: %d\n", glyph->bitmap.rows, glyph->bitmap.width);
}
return 0;
}
OS X output:
rows: 13 width: 14
rows: 13 width: 11
rows: 15 width: 13
rows: 13 width: 12
rows: 13 width: 11
rows: 13 width: 10
rows: 15 width: 13
rows: 13 width: 11
rows: 13 width: 3
rows: 14 width: 8
rows: 13 width: 11
rows: 13 width: 9
...
Win32 output:
rows: 13 width: 13
rows: 13 width: 10
rows: 13 width: 11
rows: 13 width: 11
rows: 13 width: 10
rows: 13 width: 9
rows: 13 width: 12
rows: 13 width: 11
rows: 13 width: 2
rows: 13 width: 8
rows: 13 width: 11
rows: 13 width: 8
...
One would think that the output would be identical, but it's not.
Also, there doesn't seem to be a pattern either. Sometimes the Win32
output is differs in rows or width or both. Is there something
obvious that I'm not doing or this a bug that other people have come
across?
Kevin
- [ft-devel] rendering differences between OS X and Win32,
Kevin Barabash <=