1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/thebes/gfxFontMissingGlyphs.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,40 @@ 1.4 +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- 1.5 + * This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef GFX_FONTMISSINGGLYPHS_H 1.10 +#define GFX_FONTMISSINGGLYPHS_H 1.11 + 1.12 +#include "gfxTypes.h" 1.13 +#include "gfxRect.h" 1.14 + 1.15 +class gfxContext; 1.16 + 1.17 +/** 1.18 + * This class should not be instantiated. It's just a container 1.19 + * for some helper functions. 1.20 + */ 1.21 +class gfxFontMissingGlyphs { 1.22 +public: 1.23 + /** 1.24 + * Draw hexboxes for a missing glyph. 1.25 + * @param aContext the context to draw to 1.26 + * @param aRect the glyph-box for the glyph that is missing 1.27 + * @param aChar the UTF16 codepoint for the character 1.28 + * @param aAppUnitsPerDevPixel the appUnits to devPixel ratio we're using, 1.29 + * (so we can scale glyphs to a sensible size) 1.30 + */ 1.31 + static void DrawMissingGlyph(gfxContext *aContext, 1.32 + const gfxRect& aRect, 1.33 + uint32_t aChar, 1.34 + uint32_t aAppUnitsPerDevPixel); 1.35 + /** 1.36 + * @return the desired minimum width for a glyph-box that will allow 1.37 + * the hexboxes to be drawn reasonably. 1.38 + */ 1.39 + static gfxFloat GetDesiredMinWidth(uint32_t aChar, 1.40 + uint32_t aAppUnitsPerDevUnit); 1.41 +}; 1.42 + 1.43 +#endif