1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-01 05:10:54 -08:00
emacs/src/macfont.h
YAMAMOTO Mitsuharu 5e5ee391d9 Use Core Text types/functions/variables/enumerators directly
* src/macfont.h (FontDescriptorRef, FontRef, FontSymbolicTraits)
(CharacterCollection): Remove typedefs.  All uses replaced with
definitions.
(MAC_FONT_NAME_ATTRIBUTE, MAC_FONT_FAMILY_NAME_ATTRIBUTE)
(MAC_FONT_TRAITS_ATTRIBUTE, MAC_FONT_SIZE_ATTRIBUTE)
(MAC_FONT_CASCADE_LIST_ATTRIBUTE)
(MAC_FONT_CHARACTER_SET_ATTRIBUTE, MAC_FONT_LANGUAGES_ATTRIBUTE)
(MAC_FONT_FORMAT_ATTRIBUTE, MAC_FONT_SYMBOLIC_TRAIT)
(MAC_FONT_WEIGHT_TRAIT, MAC_FONT_WIDTH_TRAIT)
(MAC_FONT_SLANT_TRAIT): Remove macros.  All uses replaced with
definitions.
(MAC_FONT_TRAIT_ITALIC, MAC_FONT_TRAIT_BOLD)
(MAC_FONT_TRAIT_MONO_SPACE, MAC_FONT_TRAIT_COLOR_GLYPHS)
(MAC_FONT_FORMAT_BITMAP)
(MAC_CHARACTER_COLLECTION_IDENTITY_MAPPING)
(MAC_CHARACTER_COLLECTION_ADOBE_JAPAN1): Remove enumerators.  All
uses replaced with definitions.
(kCTFontTraitItalic, kCTFontTraitBold, kCTFontTraitMonoSpace)
(kCTFontTraitColorGlyphs, kCTCharacterCollectionIdentityMapping)
(kCTCharacterCollectionAdobeJapan1 kCTFontOrientationDefault): Add
compatibility enumerators for older versions.
(mac_font_descriptor_create_with_attributes)
(mac_font_descriptor_create_matching_font_descriptors)
(mac_font_descriptor_create_matching_font_descriptor)
(mac_font_descriptor_copy_attribute)
(mac_font_descriptor_supports_languages)
(mac_font_create_with_name, mac_font_get_size)
(mac_font_copy_family_name, mac_font_copy_character_set)
(mac_font_get_glyphs_for_characters, mac_font_get_ascent)
(mac_font_get_descent, mac_font_get_leading)
(mac_font_get_underline_position)
(mac_font_get_underline_thickness, mac_font_copy_graphics_font)
(mac_font_copy_non_synthetic_table): Remove macros.  All uses
replaced with definitions.
(mac_font_create_preferred_family_for_attributes)
(mac_font_get_advance_width_for_glyph)
(mac_font_get_bounding_rect_for_glyph)
(mac_font_create_available_families, mac_font_shape): Remove
macros for renamed functions.
(mac_nsctfont_copy_font_descriptor): Remove unused macro.
* src/macterm.m (mac_font_descriptor_supports_languages): Rename
from mac_ctfont_descriptor_supports_languages.
(mac_font_create_preferred_family_for_attributes): Rename from
mac_ctfont_create_preferred_family_for_attributes.
(mac_font_get_advance_width_for_glyph): Rename from
mac_ctfont_get_advance_width_for_glyph.  Use
kCTFontOrientationDefault also for older versions.
(mac_font_get_bounding_rect_for_glyph): Rename from
mac_ctfont_get_bounding_rect_for_glyph. Use
kCTFontOrientationDefault also for older versions.
(mac_font_create_available_families): Rename from
mac_ctfont_create_available_families.
(mac_font_equal_in_postscript_name): Rename from
mac_ctfont_equal_in_postscript_name.  All uses changed.
(mac_font_create_line_with_string_and_font): Rename from
mac_ctfont_create_line_with_string_and_font.  All uses changed.
(mac_font_shape): Rename from mac_ctfont_shape.
(mac_font_family_compare): Remove unused declaration.
2015-08-29 17:03:55 +09:00

85 lines
2.7 KiB
C

/* Interface definition for Mac OSX Core text font backend.
Copyright (C) 2009-2015 Free Software Foundation, Inc.
This file is part of GNU Emacs.
GNU Emacs is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
Original author: YAMAMOTO Mitsuharu
*/
/* Structure used by Mac `shape' functions for storing layout
information for each glyph. */
struct mac_glyph_layout
{
/* Range of indices of the characters composed into the group of
glyphs that share the cursor position with this glyph. The
members `location' and `length' are in UTF-16 indices. */
CFRange comp_range;
/* UTF-16 index in the source string for the first character
associated with this glyph. */
CFIndex string_index;
/* Horizontal and vertical adjustments of glyph position. The
coordinate space is that of Core Text. So, the `baseline_delta'
value is negative if the glyph should be placed below the
baseline. */
CGFloat advance_delta, baseline_delta;
/* Typographical width of the glyph. */
CGFloat advance;
/* Glyph ID of the glyph. */
CGGlyph glyph_id;
};
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1080
enum {
kCTFontTraitItalic = kCTFontItalicTrait,
kCTFontTraitBold = kCTFontBoldTrait,
kCTFontTraitMonoSpace = kCTFontMonoSpaceTrait,
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
kCTFontTraitColorGlyphs = kCTFontColorGlyphsTrait
#else
kCTFontTraitColorGlyphs = (1 << 13)
#endif
};
enum {
kCTCharacterCollectionIdentityMapping = kCTIdentityMappingCharacterCollection,
kCTCharacterCollectionAdobeJapan1 = kCTAdobeJapan1CharacterCollection
};
enum {
kCTFontOrientationDefault = kCTFontDefaultOrientation
};
#endif
#if USE_CT_GLYPH_INFO
#define mac_font_get_glyph_for_cid mac_ctfont_get_glyph_for_cid
#endif
#ifndef kCTVersionNumber10_9
#define kCTVersionNumber10_9 0x00060000
#endif
#define MAC_FONT_CHARACTER_SET_STRING_ATTRIBUTE \
(CFSTR ("MAC_FONT_CHARACTER_SET_STRING_ATTRIBUTE"))
typedef const struct _EmacsScreenFont *ScreenFontRef; /* opaque */
extern void mac_register_font_driver (struct frame *f);
extern void *macfont_get_nsctfont (struct font *font);
extern void macfont_update_antialias_threshold (void);