From: Mikko Rasa Date: Mon, 30 Sep 2019 11:06:46 +0000 (+0300) Subject: Initialize members of Font::Glyph X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=refs%2Fheads%2Flegacy;p=libs%2Fgl.git Initialize members of Font::Glyph It's not safe to assume that font files contain all of the values for every glyph. --- diff --git a/source/font.cpp b/source/font.cpp index 3fd24d8e..fba9f331 100644 --- a/source/font.cpp +++ b/source/font.cpp @@ -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(f, 0) { diff --git a/source/font.h b/source/font.h index dab09fa4..a4fc71ae 100644 --- a/source/font.h +++ b/source/font.h @@ -50,6 +50,8 @@ public: float w, h; float off_x, off_y; float advance; + + Glyph(); }; private: