Skip to content

Commit 749a6d0

Browse files
committed
Add PFont methods: getSize, getName, isSmooth, getWidth
1 parent 4701f2d commit 749a6d0

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/Processing.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3509,6 +3509,10 @@ struct PFont {
35093509

35103510
PFont() = default;
35113511
PFont(const ::std::string& n, float s) : name(n), size(s), loaded(true) {}
3512+
float getSize() const { return size; }
3513+
::std::string getName() const { return name; }
3514+
bool isSmooth() const { return true; }
3515+
int getWidth(char c) const { return (int)(size*0.6f); } // approximation
35123516
};
35133517

35143518

0 commit comments

Comments
 (0)