2009-10-30 16:13:41 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
2012-05-21 04:12:37 -07:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2009-10-30 16:13:41 -07:00
|
|
|
|
|
|
|
#ifndef GFX_FT2FONTBASE_H
|
|
|
|
#define GFX_FT2FONTBASE_H
|
|
|
|
|
|
|
|
#include "cairo.h"
|
|
|
|
#include "gfxContext.h"
|
|
|
|
#include "gfxFont.h"
|
2012-05-16 15:30:10 -07:00
|
|
|
#include "mozilla/gfx/2D.h"
|
2009-10-30 16:13:41 -07:00
|
|
|
|
|
|
|
class gfxFT2FontBase : public gfxFont {
|
|
|
|
public:
|
|
|
|
gfxFT2FontBase(cairo_scaled_font_t *aScaledFont,
|
|
|
|
gfxFontEntry *aFontEntry,
|
|
|
|
const gfxFontStyle *aFontStyle);
|
|
|
|
virtual ~gfxFT2FontBase();
|
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t GetGlyph(uint32_t aCharCode);
|
|
|
|
void GetGlyphExtents(uint32_t aGlyph,
|
2009-10-30 16:13:41 -07:00
|
|
|
cairo_text_extents_t* aExtents);
|
|
|
|
virtual const gfxFont::Metrics& GetMetrics();
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual uint32_t GetSpaceGlyph();
|
|
|
|
virtual hb_blob_t *GetFontTable(uint32_t aTag);
|
2011-09-28 23:19:26 -07:00
|
|
|
virtual bool ProvidesGetGlyph() const { return true; }
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual uint32_t GetGlyph(uint32_t unicode, uint32_t variation_selector);
|
2011-09-28 23:19:26 -07:00
|
|
|
virtual bool ProvidesGlyphWidths() { return true; }
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual int32_t GetGlyphWidth(gfxContext *aCtx, uint16_t aGID);
|
2009-10-30 16:13:41 -07:00
|
|
|
|
|
|
|
cairo_scaled_font_t *CairoScaledFont() { return mScaledFont; };
|
2011-09-28 23:19:26 -07:00
|
|
|
virtual bool SetupCairoFont(gfxContext *aContext);
|
2009-10-30 16:13:41 -07:00
|
|
|
|
2012-04-11 07:55:31 -07:00
|
|
|
virtual FontType GetType() const { return FONT_TYPE_FT2; }
|
2012-05-16 15:30:10 -07:00
|
|
|
|
|
|
|
mozilla::gfx::FontOptions* GetFontOptions() { return &mFontOptions; }
|
2009-10-30 16:13:41 -07:00
|
|
|
protected:
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t mSpaceGlyph;
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mHasMetrics;
|
2009-10-30 16:13:41 -07:00
|
|
|
Metrics mMetrics;
|
2012-05-16 15:30:10 -07:00
|
|
|
|
|
|
|
// Azure font description
|
|
|
|
mozilla::gfx::FontOptions mFontOptions;
|
|
|
|
void ConstructFontOptions();
|
2009-10-30 16:13:41 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* GFX_FT2FONTBASE_H */
|