[MacPorts] #67298: R 4.3.0 is broken on 10.6.8: Symbol not found: _CTFontDrawGlyphs

MacPorts noreply at macports.org
Mon Apr 24 12:14:45 UTC 2023


#67298: R 4.3.0 is broken on 10.6.8: Symbol not found: _CTFontDrawGlyphs
---------------------------+----------------------------------
  Reporter:  barracuda156  |      Owner:  ryandesign
      Type:  defect        |     Status:  assigned
  Priority:  Normal        |  Milestone:
 Component:  ports         |    Version:  2.8.1
Resolution:                |   Keywords:  snowleopard, leopard
      Port:  R             |
---------------------------+----------------------------------

Comment (by barracuda156):

 The only instance of this symbol is in
 `src/library/grDevices/src/devQuartz.c`. And that file doubled (!) in size
 since 4.2.3.

 Code chunk in question:
 {{{
 void RQuartz_glyph(int n, int *glyphs, double *x, double *y,
                    SEXP font, double size,
                    int colour, double rot, pDevDesc dd)
 {
     DRAWSPEC;
     if (!ctx) NOCTX;
     CGContextRef savedCTX = ctx;
     CGLayerRef layer;

     if (n < 1)
         return;

     /* Not able to add glyphs to the current path. */
     if (xd->appending)
         return;

     Rboolean grouping = QuartzBegin(&ctx, &layer, xd);

     char url[501];
     snprintf(url, 500, "file://%s", R_GE_glyphFontFile(font));
     CFStringRef cfFontFileName =
         CFStringCreateWithCString(NULL, url, kCFStringEncodingUTF8);
     CFURLRef cfFontURL = CFURLCreateWithString(NULL, cfFontFileName,
 NULL);
     CFArrayRef cfFontDescriptors =
         CTFontManagerCreateFontDescriptorsFromURL(cfFontURL);
     CFRelease(cfFontFileName);
     CFRelease(cfFontURL);
     int n_fonts = CFArrayGetCount(cfFontDescriptors);
     if (n_fonts > 0) {
         /* NOTE: that the font needs an inversion (in y) matrix
            because the device has an inversion in user space
            (for bitmap devices anyway) */
         CGAffineTransform trans = CGAffineTransformMakeScale(1.0, -1.0);
         if (rot != 0.0) trans = CGAffineTransformRotate(trans,
 rot/180.*M_PI);
         CTFontRef ctFont =
             CTFontCreateWithFontDescriptor((CTFontDescriptorRef)
 CFArrayGetValueAtIndex(cfFontDescriptors, 0), size, &trans);

         CGColorSpaceRef cs =
 CGColorSpaceCreateWithName(kCGColorSpaceSRGB);
         CGFloat fillColor[] = { R_RED(colour)/255.0,
                                 R_GREEN(colour)/255.0,
                                 R_BLUE(colour)/255.0,
                                 R_ALPHA(colour)/255.0 };
         CGColorRef fillColorRef = CGColorCreate(cs, fillColor);
         CGContextSetFillColorWithColor(ctx, fillColorRef);
         int i;
         for (i=0; i<n; i++) {
             CGGlyph glyph = glyphs[i];
             CGPoint loc = CGPointMake(x[i], y[i]);
             CTFontDrawGlyphs(ctFont, &glyph, &loc, 1, ctx);
         }
         CGColorRelease(fillColorRef);
         CFRelease(ctFont);
     } else {
         warning(_("Failed to load font"));
     }
     CFRelease(cfFontDescriptors);

     QuartzEnd(grouping, layer, ctx, savedCTX, xd);
 }
 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/67298#comment:3>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list