michael@0: /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef GFX_FONTMISSINGGLYPHS_H michael@0: #define GFX_FONTMISSINGGLYPHS_H michael@0: michael@0: #include "gfxTypes.h" michael@0: #include "gfxRect.h" michael@0: michael@0: class gfxContext; michael@0: michael@0: /** michael@0: * This class should not be instantiated. It's just a container michael@0: * for some helper functions. michael@0: */ michael@0: class gfxFontMissingGlyphs { michael@0: public: michael@0: /** michael@0: * Draw hexboxes for a missing glyph. michael@0: * @param aContext the context to draw to michael@0: * @param aRect the glyph-box for the glyph that is missing michael@0: * @param aChar the UTF16 codepoint for the character michael@0: * @param aAppUnitsPerDevPixel the appUnits to devPixel ratio we're using, michael@0: * (so we can scale glyphs to a sensible size) michael@0: */ michael@0: static void DrawMissingGlyph(gfxContext *aContext, michael@0: const gfxRect& aRect, michael@0: uint32_t aChar, michael@0: uint32_t aAppUnitsPerDevPixel); michael@0: /** michael@0: * @return the desired minimum width for a glyph-box that will allow michael@0: * the hexboxes to be drawn reasonably. michael@0: */ michael@0: static gfxFloat GetDesiredMinWidth(uint32_t aChar, michael@0: uint32_t aAppUnitsPerDevUnit); michael@0: }; michael@0: michael@0: #endif