Re: pangocairo on Mac: transformation matrix and fontsize



On Dec 9, 2012, at 10:28 PM, Behdad Esfahbod <behdad behdad org> wrote:

> On 12-12-10 01:24 AM, John Ralls wrote:
>> On Dec 9, 2012, at 4:09 PM, Behdad Esfahbod <behdad behdad org> wrote:
>> 
>>> On 12-12-07 07:54 PM, John Ralls wrote:
>>> 
>>>> The next problem, which I haven't worked around yet (time to go make dinner) is in hb-ot-layout-common-private.hh, where g++ complains that OT::CoverageFormat1::Iter and OT::CoverageFormat2::Iter are private in the context of the union at line 645.
>>> 
>>> We we fixed that a few weeks ago.  Please retry.
>> 
>> It did seem familiar, but I couldn't find the changeset and I built against master, so it should be current.
> 
> Humm.  Can you attach a patch?  I'm not sure what exactly to chane.
> 
>> On Dec 9, 2012, at 9:08 PM, Behdad Esfahbod <behdad behdad org> wrote:
>> 
>>> Ok, looks like something like this should work then:
>>> 
>>> if (sizeof (void *) == 4)
>>>   OSAtomicCompareAndSwap32 (...)
>>> else
>>>   OSAtomicCompareAndSwap64 (...)
>>> 
>>> I'll give it a try.  Is 10.4 the earliest you want to support?
>> 
>> That's the current Gtk policy AFAIU, and that was Ryan's complaint.
> 
> Right, my bad.
> 
> 
>> On Dec 9, 2012, at 10:00 PM, Behdad Esfahbod <behdad behdad org> wrote:
>> 
>>> Ok, I pushed something out.  Please see if you can fix it for iOS.
>> 
>> iOS? Who's using Pango on iOS? 
> 
> Not Pango, but I know people have compiled HarfBuzz for all kinds of platforms...
> 
> b
> 
>> Anyway, I'll pull and build tomorrow morning.

Didn't *quite* work, patch to put it right -- and to support iOS -- is below.

Oddly, the private iterator problem went away. I'll have to see what I messed up there, but it was likely not building what I thought I was.

However, a much more serious problem arose once those two were accounted for:
The 10.4 SDK includes the library for CoreText, but no headers, so bb-core-text.cc won't build. I managed to get around that by copying the headers over from the 10.5 SDK plus a few hacks to make them work,along with CGFontCreateWithDataProvider, I still had:

Undefined symbols:
  "CGFontCreateWithDataProvider(CGDataProvider*)", referenced from:
      __hb_coretext_shaper_face_data_create in libharfbuzz_la-hb-coretext.o
  "_CTRunGetPositions", referenced from:
      __hb_coretext_shape in libharfbuzz_la-hb-coretext.o
  "_CTRunGetPositionsPtr", referenced from:
      __hb_coretext_shape in libharfbuzz_la-hb-coretext.o
ld: symbol(s) not found

The first one *is* in the CoreGraphics library, so it can be got around with a linker hack, but the other two aren't in the CoreText library, so you'll have to code around them somehow. But before you start, consider that it's probably not worthwhile: I don't think that many people have the expertise and confidence to go hacking inside the SDKs to get this working. 

Regards,
John Ralls


From ba21eb054bbc679734af4a8bf63b2184f4b6bda1 Mon Sep 17 00:00:00 2001
From: John Ralls <jralls ceridwen us>
Date: Mon, 10 Dec 2012 11:18:31 -0800
Subject: [PATCH]  Fix up missing OSAtomicCompareAndSwapPtrBarrier() patch

 Includes iOS handling.
---
 src/hb-atomic-private.hh |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/hb-atomic-private.hh b/src/hb-atomic-private.hh
index a4d6cbe..111d7a0 100644
--- a/src/hb-atomic-private.hh
+++ b/src/hb-atomic-private.hh
@@ -69,15 +69,17 @@ typedef long hb_atomic_int_t;
 #elif !defined(HB_NO_MT) && defined(__APPLE__)
 
 #include <libkern/OSAtomic.h>
+#ifdef __MAC_OS_X_MIN_REQUIRED
 #include <AvailabilityMacros.h>
+#elif defined(__IPHONE_OS_MIN_REQUIRED)
+#include <Availability.h>
+#endif
 
 typedef int32_t hb_atomic_int_t;
 #define hb_atomic_int_add(AI, V)	(OSAtomicAdd32Barrier ((V), &(AI)) - (V))
 
 #define hb_atomic_ptr_get(P)		(OSMemoryBarrier (), (void *) *(P))
-#if (MAX_OS_X_VERSION_MAX_ALLOWED >= MAX_OS_X_VERSION_10_5)
-/* XXX We should expand the above check to also allow iPhone OS >= 2.0, but I can't find any info re
- * AvailabilityMacros.h for iOS.  Is it even available there? */
+#if (MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4 || __IPHONE_VERSION_MIN_REQUIRED >= 20100)
 #define hb_atomic_ptr_cmpexch(P,O,N)	OSAtomicCompareAndSwapPtrBarrier ((void *) (O), (void *) (N), (void **) (P))
 #else
 #if __ppc64__ || __x86_64__
-- 
1.7.6.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]