]> git.tdb.fi Git - libs/gl.git/commitdiff
Initialize members of Font::Glyph legacy
authorMikko Rasa <tdb@tdb.fi>
Mon, 30 Sep 2019 11:06:46 +0000 (14:06 +0300)
committerMikko Rasa <tdb@tdb.fi>
Mon, 30 Sep 2019 11:06:46 +0000 (14:06 +0300)
It's not safe to assume that font files contain all of the values for
every glyph.

source/font.cpp
source/font.h

index 3fd24d8ea0ebde029e262d137dcfaf509b0db5ee..fba9f331fb7e7cbcceaaf04e21eca8215f89aa46 100644 (file)
@@ -140,6 +140,20 @@ unsigned Font::get_ligature(unsigned code, unsigned next) const
 }
 
 
+Font::Glyph::Glyph():
+       code(0),
+       x1(0),
+       y1(0),
+       x2(1),
+       y2(1),
+       w(1),
+       h(1),
+       off_x(0),
+       off_y(0),
+       advance(1)
+{ }
+
+
 Font::Loader::Loader(Font &f):
        DataFile::CollectionObjectLoader<Font>(f, 0)
 {
index dab09fa400d3ba0381eda46f5f64fb0e5f823883..a4fc71ae4fa6836a1bac48295325ff3763738ed4 100644 (file)
@@ -50,6 +50,8 @@ public:
                float w, h;
                float off_x, off_y;
                float advance;
+
+               Glyph();
        };
 
 private: