root/src/macfont.h

/* [<][>][^][v][top][bottom][index][help] */
     1 /* Interface definition for macOS Core text font backend.
     2    Copyright (C) 2009-2023 Free Software Foundation, Inc.
     3 
     4 This file is part of GNU Emacs.
     5 
     6 GNU Emacs is free software: you can redistribute it and/or modify
     7 it under the terms of the GNU General Public License as published by
     8 the Free Software Foundation, either version 3 of the License, or (at
     9 your option) any later version.
    10 
    11 GNU Emacs is distributed in the hope that it will be useful,
    12 but WITHOUT ANY WARRANTY; without even the implied warranty of
    13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14 GNU General Public License for more details.
    15 
    16 You should have received a copy of the GNU General Public License
    17 along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.
    18 
    19 Original author: YAMAMOTO Mitsuharu
    20 */
    21 
    22 /* Structure used by Mac `shape' functions for storing layout
    23    information for each glyph.  */
    24 struct mac_glyph_layout
    25 {
    26   /* Range of indices of the characters composed into the group of
    27      glyphs that share the cursor position with this glyph.  The
    28      members `location' and `length' are in UTF-16 indices.  */
    29   CFRange comp_range;
    30 
    31   /* UTF-16 index in the source string for the first character
    32      associated with this glyph.  */
    33   CFIndex string_index;
    34 
    35   /* Horizontal and vertical adjustments of glyph position.  The
    36      coordinate space is that of Core Text.  So, the `baseline_delta'
    37      value is negative if the glyph should be placed below the
    38      baseline.  */
    39   CGFloat advance_delta, baseline_delta;
    40 
    41   /* Typographical width of the glyph.  */
    42   CGFloat advance;
    43 
    44   /* Glyph ID of the glyph.  */
    45   CGGlyph glyph_id;
    46 };
    47 
    48 #if MAC_OS_X_VERSION_MAX_ALLOWED < 1080
    49 enum {
    50   kCTFontTraitItalic = kCTFontItalicTrait,
    51   kCTFontTraitBold = kCTFontBoldTrait,
    52   kCTFontTraitMonoSpace = kCTFontMonoSpaceTrait,
    53 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
    54   kCTFontTraitColorGlyphs = kCTFontColorGlyphsTrait
    55 #else
    56   kCTFontTraitColorGlyphs = (1 << 13)
    57 #endif
    58 };
    59 
    60 enum {
    61   kCTCharacterCollectionIdentityMapping = kCTIdentityMappingCharacterCollection,
    62   kCTCharacterCollectionAdobeJapan1 = kCTAdobeJapan1CharacterCollection
    63 };
    64 
    65 enum {
    66   kCTFontOrientationDefault = kCTFontDefaultOrientation
    67 };
    68 #endif
    69 
    70 #if USE_CT_GLYPH_INFO
    71 #define mac_font_get_glyph_for_cid mac_ctfont_get_glyph_for_cid
    72 #endif
    73 
    74 #ifndef kCTVersionNumber10_9
    75 #define kCTVersionNumber10_9 0x00060000
    76 #endif
    77 #define MAC_FONT_CHARACTER_SET_STRING_ATTRIBUTE \
    78   (CFSTR ("MAC_FONT_CHARACTER_SET_STRING_ATTRIBUTE"))
    79 
    80 typedef const struct _EmacsScreenFont *ScreenFontRef; /* opaque */
    81 
    82 extern void mac_register_font_driver (struct frame *f);
    83 extern void *macfont_get_nsctfont (struct font *font);
    84 extern void macfont_update_antialias_threshold (void);
    85 
    86 /* This is an undocumented function. */
    87 extern void CGContextSetFontSmoothingStyle(CGContextRef, int)
    88   __attribute__((weak_import));

/* [<][>][^][v][top][bottom][index][help] */