1 : /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 : * ***** BEGIN LICENSE BLOCK *****
3 : * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 : *
5 : * The contents of this file are subject to the Mozilla Public License Version
6 : * 1.1 (the "License"); you may not use this file except in compliance with
7 : * the License. You may obtain a copy of the License at
8 : * http://www.mozilla.org/MPL/
9 : *
10 : * Software distributed under the License is distributed on an "AS IS" basis,
11 : * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 : * for the specific language governing rights and limitations under the
13 : * License.
14 : *
15 : * The Original Code is Mozilla Foundation code.
16 : *
17 : * The Initial Developer of the Original Code is Mozilla Foundation.
18 : * Portions created by the Initial Developer are Copyright (C) 2009
19 : * the Initial Developer. All Rights Reserved.
20 : *
21 : * Contributor(s):
22 : * Vladimir Vukicevic <vladimir@mozilla.com>
23 : * Masayuki Nakano <masayuki@d-toybox.com>
24 : * Behdad Esfahbod <behdad@gnome.org>
25 : * Mats Palmgren <mats.palmgren@bredband.net>
26 : * Karl Tomlinson <karlt+@karlt.net>, Mozilla Corporation
27 : * Takuro Ashie <ashie@clear-code.com>
28 : *
29 : * Alternatively, the contents of this file may be used under the terms of
30 : * either the GNU General Public License Version 2 or later (the "GPL"), or
31 : * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
32 : * in which case the provisions of the GPL or the LGPL are applicable instead
33 : * of those above. If you wish to allow use of your version of this file only
34 : * under the terms of either the GPL or the LGPL, and not to allow others to
35 : * use your version of this file under the terms of the MPL, indicate your
36 : * decision by deleting the provisions above and replace them with the notice
37 : * and other provisions required by the GPL or the LGPL. If you do not delete
38 : * the provisions above, a recipient may use your version of this file under
39 : * the terms of any one of the MPL, the GPL or the LGPL.
40 : *
41 : * ***** END LICENSE BLOCK ***** */
42 :
43 : #ifndef GFX_FT2FONTBASE_H
44 : #define GFX_FT2FONTBASE_H
45 :
46 : #include "cairo.h"
47 : #include "gfxContext.h"
48 : #include "gfxFont.h"
49 :
50 : class gfxFT2FontBase : public gfxFont {
51 : public:
52 : gfxFT2FontBase(cairo_scaled_font_t *aScaledFont,
53 : gfxFontEntry *aFontEntry,
54 : const gfxFontStyle *aFontStyle);
55 : virtual ~gfxFT2FontBase();
56 :
57 : PRUint32 GetGlyph(PRUint32 aCharCode);
58 : void GetGlyphExtents(PRUint32 aGlyph,
59 : cairo_text_extents_t* aExtents);
60 : virtual const gfxFont::Metrics& GetMetrics();
61 : virtual PRUint32 GetSpaceGlyph();
62 : virtual hb_blob_t *GetFontTable(PRUint32 aTag);
63 0 : virtual bool ProvidesGetGlyph() const { return true; }
64 : virtual PRUint32 GetGlyph(PRUint32 unicode, PRUint32 variation_selector);
65 0 : virtual bool ProvidesGlyphWidths() { return true; }
66 : virtual PRInt32 GetGlyphWidth(gfxContext *aCtx, PRUint16 aGID);
67 :
68 0 : cairo_scaled_font_t *CairoScaledFont() { return mScaledFont; };
69 : virtual bool SetupCairoFont(gfxContext *aContext);
70 :
71 : protected:
72 : PRUint32 mSpaceGlyph;
73 : bool mHasMetrics;
74 : Metrics mMetrics;
75 : };
76 :
77 : #endif /* GFX_FT2FONTBASE_H */
|