CENTRE_OF_SCREEN -> VERTICAL_CENTRE_OF_SCREEN.
[libsub.git] / src / font_size.cc
index d11ee89e4f979acefcd2f325db06963dbd7e556b..00a74cfe8fc342bd21acf78e5911164c9de31f03 100644 (file)
@@ -40,3 +40,31 @@ FontSize::points (int screen_height_in_points) const
 
        return _proportional.get() * screen_height_in_points;
 }
+
+FontSize
+FontSize::from_points (int p)
+{
+       FontSize s;
+       s.set_points (p);
+       return s;
+}
+
+FontSize
+FontSize::from_proportional (float p)
+{
+       FontSize s;
+       s.set_proportional (p);
+       return s;
+}
+
+bool
+FontSize::specified () const
+{
+       return _proportional || _points;
+}
+
+bool
+sub::operator== (FontSize const & a, FontSize const & b)
+{
+       return a.proportional() == b.proportional() && a.points() == b.points();
+}