1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
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_FONTMISSINGGLYPHS_H
7 #define GFX_FONTMISSINGGLYPHS_H
9 #include "mozilla/Attributes.h"
10 #include "mozilla/gfx/MatrixFwd.h"
11 #include "mozilla/gfx/Rect.h"
18 } // namespace mozilla
21 * This class should not be instantiated. It's just a container
22 * for some helper functions.
24 class gfxFontMissingGlyphs final
{
25 typedef mozilla::gfx::DrawTarget DrawTarget
;
26 typedef mozilla::gfx::Float Float
;
27 typedef mozilla::gfx::Matrix Matrix
;
28 typedef mozilla::gfx::Pattern Pattern
;
29 typedef mozilla::gfx::Rect Rect
;
31 gfxFontMissingGlyphs() = delete; // prevent instantiation
35 * Draw hexboxes for a missing glyph.
36 * @param aChar the UTF16 codepoint for the character
37 * @param aRect the glyph-box for the glyph that is missing
38 * @param aDrawTarget the DrawTarget to draw to
39 * @param aPattern the pattern currently being used to paint
40 * @param aMat optional local-space orientation matrix
42 static void DrawMissingGlyph(uint32_t aChar
, const Rect
& aRect
,
43 DrawTarget
& aDrawTarget
, const Pattern
& aPattern
,
44 const Matrix
* aMat
= nullptr);
46 * @return the desired minimum width for a glyph-box that will allow
47 * the hexboxes to be drawn reasonably.
49 static Float
GetDesiredMinWidth(uint32_t aChar
, uint32_t aAppUnitsPerDevUnit
);
53 static void Shutdown();