[HarfBuzz] Fixes for harfbuzz-ng on Windows MSVC2010
Koji Ishii
kojiishi at gmail.com
Mon Jul 9 05:15:19 PDT 2012
Hi Eduardo,
My build environment requires a bit of manual process for now. Here's what I
did:
1. Create "msvc" directory and extract attached files into it.
2. Copy src/hb-version.h.in to src/hb-version.h and replaced appropriate
variables (by hand edits)
3. Run ragel in src directory:
ragel -e -F1 -o hb-ot-shape-complex-indic-machine.hh
hb-ot-shape-complex-indic-machine.rl
I didn't run gen-*.py, nor looked into much what they're for, as supporting
Arabic/Indic isn't my priority for now.
I'm interested in the possibility of using harfbuzz-ng for East Asian
typography (vertical flow) on Windows and on Linux with minimal dependencies
to other modules, and just started learning, so I apologize in advance if I
miss anything important. I'm still at the point where it's built on Windows,
run, and saw it can dump both TTF and OTF correctly.
Regards,
Koji
-----Original Message-----
From: harfbuzz-bounces+kojiishi=gmail.com at lists.freedesktop.org
[mailto:harfbuzz-bounces+kojiishi=gmail.com at lists.freedesktop.org] On Behalf
Of Eduardo Castineyra
Sent: Monday, July 9, 2012 6:19 PM
To: harfbuzz at lists.freedesktop.org
Subject: Re: [HarfBuzz] Fixes for harfbuzz-ng on Windows MSVC2010
Hi Koji,
Would you mind sending me the solution and project to compile in 2010? I
tried it once but I got far to get it.
Thanks!
On 08/07/2012 5:37, Koji Ishii wrote:
> Hi,
>
> I tried to build harfbuzz-ng on Windows MSVC2010 and got a few errors.
> I'm not sure how many people needs this but I'm sharing the patches
> here for who is interested in.
>
> hb-atomic-private.hh fix is for x86 only. The current code builds fine
> for x64 but not for x86.
>
> hb-unicode-private.hh fix is probably not related with Windows nor
> MSVC, but when neither GLIB nor ICU is available.
>
> hb-uniscribe.cc fix is required for me, maybe Windows SDK was changed?
> I'm using VC2010 SP1, but the fix should be safe for prior compilers I
> believe.
>
>
> Regards,
> Koji
>
> commit c5174b35c59ee80ed8e81989ddeb73baabbfe9ed
> Author: Koji Ishii <kojiishi at gmail.com>
> Date: Sat Jul 7 23:45:23 2012 +0900
>
> msvc10 fixes
>
> diff --git a/src/hb-atomic-private.hh b/src/hb-atomic-private.hh index
> 918852d..967b6c0 100644
> --- a/src/hb-atomic-private.hh
> +++ b/src/hb-atomic-private.hh
> @@ -45,7 +45,15 @@
> #elif !defined(HB_NO_MT) && defined(_MSC_VER) && _MSC_VER >= 1600
>
> #include <intrin.h>
> +#if defined(_M_IX86)
> +#define _InterlockedCompareExchangePointer(_Target, _Exchange,
> _Comparand) reinterpret_cast<void *>(static_cast<__w64
> long>(_InterlockedCompareExchange( \
> + static_cast<long volatile *>(reinterpret_cast<__w64 long volatile
> *>(static_cast<void * volatile *>(_Target))), \
> + static_cast<long>(reinterpret_cast<__w64 long>(static_cast<void
> *>(_Exchange))), \
> + static_cast<long>(reinterpret_cast<__w64 long>(static_cast<void
> *>(_Comparand))))))
> +#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))
> diff --git a/src/hb-unicode-private.hh b/src/hb-unicode-private.hh
> index eaf151a..c781035 100644
> --- a/src/hb-unicode-private.hh
> +++ b/src/hb-unicode-private.hh
> @@ -99,6 +99,7 @@ extern HB_INTERNAL const hb_unicode_funcs_t
> _hb_icu_unicode_funcs;
> #define _hb_unicode_funcs_default _hb_icu_unicode_funcs
> #else
> #define HB_UNICODE_FUNCS_NIL 1
> +extern HB_INTERNAL const hb_unicode_funcs_t _hb_unicode_funcs_nil;
> #define _hb_unicode_funcs_default _hb_unicode_funcs_nil
> #endif
>
> diff --git a/src/hb-uniscribe.cc b/src/hb-uniscribe.cc index
> b71b00a..3bedc7d 100644
> --- a/src/hb-uniscribe.cc
> +++ b/src/hb-uniscribe.cc
> @@ -29,6 +29,10 @@
> #include "hb-private.hh"
>
> #include <windows.h>
> +// usp10.h defines UNISCRIBE_OPENTYPE only if _WIN32_WINNT >= 0x0600
> +#if !defined(UNISCRIBE_OPENTYPE) && (_WIN32_WINNT < 0x0600) #define
> +UNISCRIBE_OPENTYPE 0x0100 #endif
> #include <usp10.h>
>
> typedef ULONG WIN_ULONG;
> _______________________________________________
> HarfBuzz mailing list
> HarfBuzz at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/harfbuzz
_______________________________________________
HarfBuzz mailing list
HarfBuzz at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/harfbuzz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: harfbuzz-vcproj.zip
Type: application/x-zip-compressed
Size: 4945 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/harfbuzz/attachments/20120709/b203efef/attachment.bin>
More information about the HarfBuzz
mailing list