gfx/thebes/gfxCoreTextShaper.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
     2  * This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #ifndef GFX_CORETEXTSHAPER_H
     7 #define GFX_CORETEXTSHAPER_H
     9 #include "gfxFont.h"
    11 #include <ApplicationServices/ApplicationServices.h>
    13 class gfxMacFont;
    15 class gfxCoreTextShaper : public gfxFontShaper {
    16 public:
    17     gfxCoreTextShaper(gfxMacFont *aFont);
    19     virtual ~gfxCoreTextShaper();
    21     virtual bool ShapeText(gfxContext      *aContext,
    22                            const char16_t *aText,
    23                            uint32_t         aOffset,
    24                            uint32_t         aLength,
    25                            int32_t          aScript,
    26                            gfxShapedText   *aShapedText);
    28     // clean up static objects that may have been cached
    29     static void Shutdown();
    31 protected:
    32     CTFontRef mCTFont;
    33     CFDictionaryRef mAttributesDict;
    35     nsresult SetGlyphsFromRun(gfxShapedText *aShapedText,
    36                               uint32_t       aOffset,
    37                               uint32_t       aLength,
    38                               CTRunRef       aCTRun,
    39                               int32_t        aStringOffset);
    41     CTFontRef CreateCTFontWithDisabledLigatures(CGFloat aSize);
    43     static void CreateDefaultFeaturesDescriptor();
    45     static CTFontDescriptorRef GetDefaultFeaturesDescriptor() {
    46         if (sDefaultFeaturesDescriptor == nullptr) {
    47             CreateDefaultFeaturesDescriptor();
    48         }
    49         return sDefaultFeaturesDescriptor;
    50     }
    52     // cached font descriptor, created the first time it's needed
    53     static CTFontDescriptorRef    sDefaultFeaturesDescriptor;
    55     // cached descriptor for adding disable-ligatures setting to a font
    56     static CTFontDescriptorRef    sDisableLigaturesDescriptor;
    57 };
    59 #endif /* GFX_CORETEXTSHAPER_H */

mercurial