[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Devel] memcpy from
From: |
Jeff Wolkenhauer |
Subject: |
[Devel] memcpy from |
Date: |
Wed, 04 Apr 2001 11:30:18 -0700 |
Hello all,
I'm running into a very weird problem that I'm hoping one of you may have seen
before and can clue me in on.
I'm using freetype 2.0 with a project on a Windows 2000 machine, Visual C/C++
6.0. I am attempting to get the localized Unicode family name string from some
TrueType Collection (.ttc) files.
I'm making a call:
ft_err = FT_Get_Sfnt_Name (ftFace, /* from FT_New_Face(...) */
i, /* desired index into nametable */
sfnt_nm); /* address of FT_SfntName struct */
If sfnt_nm's platform_id and encoding_id etc. are what I want, I attempt to copy
sfnt_nm.string.
Here's the weird part. Even though sfnt_nm.string_len is, say, 14, I can only
reliably copy the first 10 characters (0-9). The reason for this seems to be a
problem in referencing the original array sfnt_nm.string.
For example, given: int j = 11,
sfnt_nm.string[j] is NOT equal to sfnt_nm.string[11].
So I get correct bytes for the first several elements, but incorrect bytes for
the rest.
I've eliminated simple things like old/incompatible headers and libraries -
assuring fresh compilation, etc. - as possibilities. I've tried memcpy as well
as using a simple for loop, static variables and local variables.
I thought perhaps a complier/system bug, but it may also be something in the
freetype library and I thought I'd ask here. I saw one thing that has given me
pause in FT_Get_Sfnt_Name. That is the assignment
TT_Face ttface = (TT_Face)face;
face being an FT_Face and a much smaller structure than TT_Face. Even though
the first element of TT_Face is an FT_Face structure.
Has anyone ever seen similar behaviour, even outside of freetype?
I would appreciate any comments, help or suggestions.
Regards,
Jeff
--
- [Devel] memcpy from,
Jeff Wolkenhauer <=