openframeworks / openframeworks/openFrameworks

ofTrueTypeFont::getSpaceSize() always returns zero after loading a font

Open
#5,547 1 comment 0 reactions 1 assignee View on GitHub

@bakercp is already working on this.

Since May 19, 2017.

section-typography
Dominant language
C++
Stars
10.4k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
9

Description

I found out ofTrueTypeFont::getSpaceSize() returns zero after loading a font.
It only seemed to work once I manually set it with setSpaceSize().
I tried it with several different fonts but the results were always the same.

void ofApp::setup(){

    font.load("font.ttf", 50);
    cout << "First : " << font.getSpaceSize() << endl;
    font.setSpaceSize(20);
    cout << "Second : " << font.getSpaceSize() << endl;
}

result :

First : 0
Second : 20

@arturoc asked me to open an issue here.

Original forum post :
https://forum.openframeworks.cc/t/oftruetypefont-how-to-get-the-current-spacesize-after-loading/

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.