Removed ! operator from GlyphIndex

This commit is contained in:
Todd York 2022-04-08 04:52:08 +08:00
parent 4e8ff2321e
commit a810610a09
No known key found for this signature in database
GPG Key ID: 99B69934F10B19DB
3 changed files with 3 additions and 6 deletions

View File

@ -88,10 +88,6 @@ unsigned GlyphIndex::getIndex() const {
return index;
}
bool GlyphIndex::operator!() const {
return index == 0;
}
FreetypeHandle * initializeFreetype() {
FreetypeHandle *handle = new FreetypeHandle;
FT_Error error = FT_Init_FreeType(&handle->library);

View File

@ -17,7 +17,6 @@ class GlyphIndex {
public:
explicit GlyphIndex(unsigned index = 0);
unsigned getIndex() const;
bool operator!() const;
private:
unsigned index;

View File

@ -442,6 +442,7 @@ int main(int argc, const char * const *argv) {
const char *testRender = NULL;
const char *testRenderMulti = NULL;
bool outputSpecified = false;
bool glyphIndexSpecified = false;
GlyphIndex glyphIndex;
unicode_t unicode = 0;
int svgPathIndex = 0;
@ -504,6 +505,7 @@ int main(int argc, const char * const *argv) {
case 'G': case 'g':
if (parseUnsignedDecOrHex(gi, charArg+1))
glyphIndex = GlyphIndex(gi);
glyphIndexSpecified = true;
break;
case 'U': case 'u':
++charArg;
@ -838,7 +840,7 @@ int main(int argc, const char * const *argv) {
break;
}
case FONT: {
if (!glyphIndex && !unicode)
if (!glyphIndexSpecified && !unicode)
ABORT("No character specified! Use -font <file.ttf/otf> <character code>. Character code can be a Unicode index (65, 0x41), a character in apostrophes ('A'), or a glyph index prefixed by g (g36, g0x24).");
FreetypeHandle *ft = initializeFreetype();
if (!ft) return -1;