/usr/include/Wt/WFontMetrics is in libwt-dev 3.1.10-1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | // This may look like C code, but it's really -*- C++ -*-
/*
* Copyright (C) 2008 Emweb bvba, Kessel-Lo, Belgium.
*
* See the LICENSE file for terms of use.
*/
#ifndef WFONTMETRICS_H_
#define WFONTMETRICS_H_
#include <Wt/WFont>
namespace Wt {
/*
* Size is like font size.
*
* height = leading + ascent + descent
*/
/*! \class WFontMetrics Wt/WFontMetrics Wt/WFontMetrics
* \brief Font metrics class.
*
* This class provides font metrics for a given font. It is returned
* by an implementation of WPaintDevice::fontMetrics(), and may differ
* between devices.
*
* All methods return pixel dimensions.
*
* \sa WPaintDevice
*/
class WT_API WFontMetrics
{
public:
/*! \brief Creates a font metrics information object.
*/
WFontMetrics(const WFont& font, double leading, double ascent,
double descent);
/*! \brief Returns the font for which these font metrics were computed.
*/
const WFont& font() const { return font_; }
/*! \brief Returns the font size.
*
* This is the same as:
* \code
* font().size().sizeLength()
* \endcode
*
* e.g.~for a font with size set to 16px, this returns 16.
*/
double size() const;
/*! \brief Returns the font height.
*
* The font height is the total height of a text line. It is usually
* a bit bigger than the font size to have natural line spacing.
*/
double height() const { return leading_ + ascent_ + descent_; }
/*! \brief Returns the font leading length.
*
* This is vertical space provided on top of the ascent (empty space
* which serves as natural line spacing).
*/
double leading() const { return leading_; }
/*! \brief Returns the font ascent length.
*
* This is vertical space which corresponds to the maximum height of a
* character over the baseline (although many fonts violate this for
* some glyphs).
*/
double ascent() const { return ascent_; }
/*! \brief Returns the font descent length.
*
* This is vertical space which corresponds to the maximum height of a
* character under the baseline (although many fonts violate this for
* some glyphs).
*/
double descent() const { return descent_; }
private:
WFont font_;
double leading_, ascent_, descent_;
};
}
#endif // WFONT_METRICS_H_
|