Re: [HarfBuzz] Thai rendering problem
Also, you can simply use util/hb-view or util/hb-shape for testing. b On 07/14/2012 02:35 PM, Behdad Esfahbod wrote: > Hi Sun Mi Shin, > > Can you provide input text and HarfBuzz versus expected output? > > Also, 0.7.0 is fairly old, please use a newer snapshot from here: > > http://www.freedesktop.org/software/harfbuzz/release/ > > There are very small changes in the API. The only one I can remember off the > top of my head is that hb_buffer_create() does not take any parameter anymore. > > Cheers, > behdad > > On 07/14/2012 02:06 PM, 신선미 wrote: >> Hi, I'm Sun Mi Shin. >> >> I'm HB newers and using HB for rendering Thai language. >> >> I ran simple application but it display incorrect output. >> >> I test thai rendering with HB shape output( info codepoint, glyph positions >> ). >> >> But the glyphs appears that they are just decomposed when I print them out on >> our canvas. >> >> >> >> My test program is below. Am I doing somethig wrong? >> >> Please correct following program problems. >> >> I'm using HB 0.7.0. >> >> Thank you. >> >> >>buffer = hb_buffer_create(len); >>hb_buffer_set_unicode_funcs(buffer, hb_unicode_funcs_get_default()); >>hb_buffer_set_language(buffer, hb_language_from_string("th")); >>hb_buffer_set_script(buffer, HB_SCRIPT_THAI); >> >>hb_buffer_set_direction(buffer, HB_DIRECTION_LTR); >> >>hb_buffer_add_utf32(buffer, (const uint32_t *) text, len, 0, len); >> >> >> >>hb_font_t *hb_ft_font; >> >>hb_font_t *hb_sub_font; >> >>hb_ft_font = hb_ft_font_create(face, NULL); >>hb_sub_font = hb_font_create_sub_font(hb_ft_font); >>hb_font_destroy(hb_ft_font); >> >> >> >>hb_shape(hb_sub_font, buffer, NULL, 0); >> >> >> >>unsigned int slen = hb_buffer_get_length(buffer); >>positions = hb_buffer_get_glyph_positions(buffer, NULL); >>infos = hb_buffer_get_glyph_infos(buffer, NULL); >> >> >> >> ___ >> HarfBuzz mailing list >> HarfBuzz@lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/harfbuzz ___ HarfBuzz mailing list HarfBuzz@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/harfbuzz
Re: [HarfBuzz] Thai rendering problem
Hi Sun Mi Shin, Can you provide input text and HarfBuzz versus expected output? Also, 0.7.0 is fairly old, please use a newer snapshot from here: http://www.freedesktop.org/software/harfbuzz/release/ There are very small changes in the API. The only one I can remember off the top of my head is that hb_buffer_create() does not take any parameter anymore. Cheers, behdad On 07/14/2012 02:06 PM, 신선미 wrote: > Hi, I'm Sun Mi Shin. > > I'm HB newers and using HB for rendering Thai language. > > I ran simple application but it display incorrect output. > > I test thai rendering with HB shape output( info codepoint, glyph positions ). > > But the glyphs appears that they are just decomposed when I print them out on > our canvas. > > > > My test program is below. Am I doing somethig wrong? > > Please correct following program problems. > > I'm using HB 0.7.0. > > Thank you. > > >buffer = hb_buffer_create(len); >hb_buffer_set_unicode_funcs(buffer, hb_unicode_funcs_get_default()); >hb_buffer_set_language(buffer, hb_language_from_string("th")); >hb_buffer_set_script(buffer, HB_SCRIPT_THAI); > >hb_buffer_set_direction(buffer, HB_DIRECTION_LTR); > >hb_buffer_add_utf32(buffer, (const uint32_t *) text, len, 0, len); > > > >hb_font_t *hb_ft_font; > >hb_font_t *hb_sub_font; > >hb_ft_font = hb_ft_font_create(face, NULL); >hb_sub_font = hb_font_create_sub_font(hb_ft_font); >hb_font_destroy(hb_ft_font); > > > >hb_shape(hb_sub_font, buffer, NULL, 0); > > > >unsigned int slen = hb_buffer_get_length(buffer); >positions = hb_buffer_get_glyph_positions(buffer, NULL); >infos = hb_buffer_get_glyph_infos(buffer, NULL); > > > > ___ > HarfBuzz mailing list > HarfBuzz@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/harfbuzz ___ HarfBuzz mailing list HarfBuzz@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/harfbuzz
[HarfBuzz] Thai rendering problem
Hi, I'm Sun Mi Shin. I'm HB newers and using HB for rendering Thai language. I ran simple application but it display incorrect output. I test thai rendering with HB shape output( info codepoint, glyph positions ). But the glyphs appears that they are just decomposed when I print them out on our canvas. My test program is below. Am I doing somethig wrong? Please correct following program problems. I'm using HB 0.7.0. Thank you. buffer = hb_buffer_create(len); hb_buffer_set_unicode_funcs(buffer, hb_unicode_funcs_get_default()); hb_buffer_set_language(buffer, hb_language_from_string("th")); hb_buffer_set_script(buffer, HB_SCRIPT_THAI); hb_buffer_set_direction(buffer, HB_DIRECTION_LTR); hb_buffer_add_utf32(buffer, (const uint32_t *) text, len, 0, len); hb_font_t *hb_ft_font; hb_font_t *hb_sub_font; hb_ft_font = hb_ft_font_create(face, NULL); hb_sub_font = hb_font_create_sub_font(hb_ft_font); hb_font_destroy(hb_ft_font); hb_shape(hb_sub_font, buffer, NULL, 0); unsigned int slen = hb_buffer_get_length(buffer); positions = hb_buffer_get_glyph_positions(buffer, NULL); infos = hb_buffer_get_glyph_infos(buffer, NULL); ___ HarfBuzz mailing list HarfBuzz@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/harfbuzz
[HarfBuzz] harfbuzz-ng: Branch 'master' - 2 commits
src/hb-atomic-private.hh |5 - src/hb-warning.cc| 29 + 2 files changed, 5 insertions(+), 29 deletions(-) New commits: commit fa2bd9fb63d83b657373764d4b657084d8327fc9 Author: Behdad Esfahbod Date: Sat Jul 14 12:15:54 2012 -0400 Further simplify atomic ops on Visual Studio diff --git a/src/hb-atomic-private.hh b/src/hb-atomic-private.hh index a833a6c..0f70641 100644 --- a/src/hb-atomic-private.hh +++ b/src/hb-atomic-private.hh @@ -46,12 +46,7 @@ #include /* On x86, _InterlockedCompareExchangePointer is a macro defined in concrt.h */ -#if defined(_M_IX86) #include -#pragma intrinsic(_InterlockedExchangeAdd) -#else -#pragma intrinsic(_InterlockedExchangeAdd, _InterlockedCompareExchangePointer) -#endif typedef long hb_atomic_int_t; #define hb_atomic_int_add(AI, V) _InterlockedExchangeAdd (&(AI), (V)) commit 0a492357016bc9a614d2a726f2006c10af68ca58 Author: Behdad Esfahbod Date: Fri Jul 13 13:20:49 2012 -0400 Minor diff --git a/src/hb-warning.cc b/src/hb-warning.cc index 4f1f65f..8ff4d20 100644 --- a/src/hb-warning.cc +++ b/src/hb-warning.cc @@ -29,38 +29,19 @@ #if defined(HB_ATOMIC_INT_NIL) -#ifdef _MSC_VER -#pragma message("Could not find any system to define atomic_int macros, library may NOT be thread-safe") -#else -#warning "Could not find any system to define atomic_int macros, library may NOT be thread-safe" +#pragma message("Could not find any system to define atomic_int macros, library may NOT be thread-safe.") #endif -#endif - #if defined(HB_MUTEX_IMPL_NIL) -#ifdef _MSC_VER -#pragma message("Could not find any system to define mutex macros, library may NOT be thread-safe") -#else -#warning "Could not find any system to define mutex macros, library may NOT be thread-safe" -#endif +#pragma message("Could not find any system to define mutex macros, library may NOT be thread-safe.") #endif - #if defined(HB_ATOMIC_INT_NIL) || defined(HB_MUTEX_IMPL_NIL) -#ifdef _MSC_VER -#pragma message("To suppress these warnings, define HB_NO_MT") -#else -#warning "To suppress these warnings, define HB_NO_MT" -#endif +#pragma message("To suppress these warnings, define HB_NO_MT.") #endif #include "hb-unicode-private.hh" #if !defined(HB_NO_UNICODE_FUNCS) && defined(HB_UNICODE_FUNCS_NIL) -#ifdef _MSC_VER -#pragma message("Could not find any Unicode functions implementation, you have to provide your own") -#pragma message("To suppress this warnings, define HB_NO_UNICODE_FUNCS") -#else -#warning "Could not find any Unicode functions implementation, you have to provide your own" -#warning "To suppress this warning, define HB_NO_UNICODE_FUNCS" -#endif +#pragma message("Could not find any Unicode functions implementation, you have to provide your own.") +#pragma message("To suppress this warnings, define HB_NO_UNICODE_FUNCS.") #endif ___ HarfBuzz mailing list HarfBuzz@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/harfbuzz
Re: [HarfBuzz] Fixes for harfbuzz-ng on Windows MSVC2010
On 07/14/2012 01:21 AM, Koji Ishii wrote: > Thank you Behdad for pushing the changes. > >> Can you please confirm that in general the intrinsic pragmas are needed at >> all? > > That's a good point. It looks to me that it doesn't do anything. > > I removed the two "#pragma intrinsic" in hb-atomic-private.hh, but all config > (x86/x64, debug/release) still compile and there's no diff in the asm output > both in x86 and x64. > > So I guess you can safely remove them. Good. So the only difference is the concrt.h inclusion. I assume I can include that unconditionally? b > > Regards, > Koji > > -Original Message- > From: Behdad Esfahbod [mailto:behdad.esfah...@gmail.com] On Behalf Of Behdad > Esfahbod > Sent: Friday, July 13, 2012 10:04 PM > To: Koji Ishii > Cc: harfbuzz@lists.freedesktop.org > Subject: Re: [HarfBuzz] Fixes for harfbuzz-ng on Windows MSVC2010 > > Hi Koji, > > Thanks. Comments below. > > On 07/12/2012 12:33 PM, Koji Ishii wrote: >> hb-atomic-private.hh fix is for x86 only. The current code builds fine for x64 but not for x86. >>> >>> I don't understand why this is needed. According to: >>> >>> http://msdn.microsoft.com/en-us/library/1b4s3xf5%28v=vs.80%29.aspx >>> >>> _InterlockedCompareExchangePointer is available on both x86 and x64. >> >> And the page says: >> Note On the x86 architecture, _InterlockedCompareExchangePointer is a >> macro that calls _InterlockedCompareExchange. >> >> So, you can't declare it as intrinsic, and the macro is defined in concrt.h, >> not in intrin.h. > > I see... > > Can you please confirm that in general the intrinsic pragmas are needed at > all? > > I'm pushed your suggested change out now. > > behdad > >> I guess I've got better fix thanks to your advice. How's this? This compiles >> good too, and we don't hard code the macro any longer. I still see some >> warnings on both x86/x64, but that's a separate issue. >> >> Regards, >> Koji >> >> diff --git a/src/hb-atomic-private.hh b/src/hb-atomic-private.hh index >> 918852d..3653608 100644 >> --- a/src/hb-atomic-private.hh >> +++ b/src/hb-atomic-private.hh >> @@ -45,7 +45,12 @@ >> #elif !defined(HB_NO_MT) && defined(_MSC_VER) && _MSC_VER >= 1600 >> >> #include >> +#if defined(_M_IX86) >> +#include >> +#pragma intrinsic(_InterlockedExchangeAdd) >> +#else >> #pragma intrinsic(_InterlockedExchangeAdd, >> _InterlockedCompareExchangePointer) >> +#endif >> >> typedef long hb_atomic_int_t; >> #define hb_atomic_int_add(AI, V)_InterlockedExchangeAdd (&(AI), (V)) >> >> > > ___ HarfBuzz mailing list HarfBuzz@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/harfbuzz