]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/FontMetrics.h
Add Sam Crawley to credits.
[lyx.git] / src / frontends / FontMetrics.h
index 1c1a658f8a4e4fdc09a1ad878f3823e21e45ace5..d6e63541401a5cd15b81209e5cea326d072afe2f 100644 (file)
@@ -65,6 +65,20 @@ public:
        virtual Dimension const defaultDimension() const = 0;
        /// return the em size
        virtual int em() const = 0;
+       /// return the x height
+       virtual int xHeight() const = 0;
+       /// return the width of a line for underlining
+       virtual int lineWidth() const = 0;
+       /// return the distance from the base line to where an underline
+       /// should be drawn.
+       virtual int underlinePos() const = 0;
+       /// return the distance from the base line to where the strike out line
+       /// should be drawn.
+       virtual int strikeoutPos() const = 0;
+       /// return true if font is not upright (italic or oblique)
+       virtual bool italic() const = 0;
+       /// return slope for italic font
+       virtual double italicSlope() const = 0;
 
        /// return the width of the char in the font
        virtual int width(char_type c) const = 0;
@@ -85,7 +99,7 @@ public:
         * direction of the string is forced, and the returned value
         * is from the left edge of the word, not from the start of the string.
         * \param rtl is true for right-to-left layout
-        * \param ws is the amount of extra inter-word space applied text justication.
+        * \param ws is the amount of extra inter-word space applied text justification.
         */
        virtual int pos2x(docstring const & s, int pos, bool rtl, double ws) const = 0;
        /**
@@ -94,7 +108,7 @@ public:
         * is from the left edge of the word, not from the start of the string.
         * the offset x is updated to match the closest position in the string.
         * \param rtl is true for right-to-left layout
-        * \param ws is the amount of extra inter-word space applied text justication.
+        * \param ws is the amount of extra inter-word space applied text justification.
         */
        virtual int x2pos(docstring const & s, int & x, bool rtl, double ws) const = 0;
        /**
@@ -117,9 +131,10 @@ public:
                int & descent) const = 0;
        /**
         * fill in width,ascent,descent with the values for the
-        * given string in the font for a button.
+        * given string in the font for a button with given offset.
         */
        virtual void buttonText(docstring const & str,
+               const int offset,
                int & width,
                int & ascent,
                int & descent) const = 0;
@@ -134,6 +149,10 @@ public:
        inline int center(char_type c) const {
                return (rbearing(c) - lbearing(c)) / 2;
        }
+
+       /// return the number of expanding characters taken into account for
+       /// increased inter-word spacing during justification
+       virtual int countExpanders(docstring const & str) const = 0;
 };