Tweak ISO6937 mapping to put $ sign on 0xa4 (164) (from master).
[libsub.git] / src / font_size.h
index 2be2434c0381d1af6bca96ed2969813860579f79..2ff4a7c66d8f19bdad7512277343417b6c847511 100644 (file)
 #ifndef LIBSUB_FONT_SIZE_H
 #define LIBSUB_FONT_SIZE_H
 
+#include <boost/optional.hpp>
+
 namespace sub {
-       
+
+/** @class FontSize
+ *  @brief A description of a font's size in one of a number of ways.
+ *
+ *  An object of this class holds a font's size in one way, and it can convert
+ *  to another on supply of the required conversion parameters.
+ */
 class FontSize
 {
 public:
        void set_proportional (float p) {
                _proportional = p;
        }
-       
+
        void set_points (int p) {
                _points = p;
        }
@@ -36,20 +44,24 @@ public:
        boost::optional<float> proportional () const {
                return _proportional;
        }
-       
+
        boost::optional<int> points () const {
                return _points;
        }
-       
+
+       bool specified () const;
+
        float proportional (int screen_height_in_points) const;
        int points (int screen_height_in_points) const;
-       
-private:               
+
+       static FontSize from_points (int p);
+
+private:
        /** as a proportion of screen height */
        boost::optional<float> _proportional;
        /** in points */
        boost::optional<int> _points;
-       
+
 };
 
 }