gfx/thebes/gfxFT2FontBase.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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_FT2FONTBASE_H
     7 #define GFX_FT2FONTBASE_H
     9 #include "cairo.h"
    10 #include "gfxContext.h"
    11 #include "gfxFont.h"
    12 #include "mozilla/gfx/2D.h"
    14 class gfxFT2FontBase : public gfxFont {
    15 public:
    16     gfxFT2FontBase(cairo_scaled_font_t *aScaledFont,
    17                    gfxFontEntry *aFontEntry,
    18                    const gfxFontStyle *aFontStyle);
    19     virtual ~gfxFT2FontBase();
    21     uint32_t GetGlyph(uint32_t aCharCode);
    22     void GetGlyphExtents(uint32_t aGlyph,
    23                          cairo_text_extents_t* aExtents);
    24     virtual const gfxFont::Metrics& GetMetrics();
    25     virtual uint32_t GetSpaceGlyph();
    26     virtual bool ProvidesGetGlyph() const { return true; }
    27     virtual uint32_t GetGlyph(uint32_t unicode, uint32_t variation_selector);
    28     virtual bool ProvidesGlyphWidths() { return true; }
    29     virtual int32_t GetGlyphWidth(gfxContext *aCtx, uint16_t aGID);
    31     cairo_scaled_font_t *CairoScaledFont() { return mScaledFont; };
    32     virtual bool SetupCairoFont(gfxContext *aContext);
    34     virtual FontType GetType() const { return FONT_TYPE_FT2; }
    36     mozilla::gfx::FontOptions* GetFontOptions() { return &mFontOptions; }
    37 protected:
    38     uint32_t mSpaceGlyph;
    39     bool mHasMetrics;
    40     Metrics mMetrics;
    42     // Azure font description
    43     mozilla::gfx::FontOptions  mFontOptions;
    44     void ConstructFontOptions();
    45 };
    47 #endif /* GFX_FT2FONTBASE_H */

mercurial