Skip to content

Commit

Permalink
Correct text size calculation for #71.
Browse files Browse the repository at this point in the history
  • Loading branch information
DarwinNE committed May 8, 2020
1 parent 47658a0 commit 6686640
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
11 changes: 3 additions & 8 deletions src/net/sourceforge/fidocadj/graphic/DecoratedText.java
Expand Up @@ -137,22 +137,17 @@ public void drawString(String str,
*/
resetTokenization(str);
int xc=x;
double fontSize;
fontSize=g.getFontSize();
double fontSize=g.getFontSize();
int t;
while((t=getToken())!=END) {
switch(t) {
case CHUNK:
// DB: I am not entirely sure to understand where the
// 20 comes from...
g.setFontSize(fontSize*getSizeMultLevel()*
g.getZoom()/20);
g.setFontSize(fontSize*getSizeMultLevel());
// Font size is given in points, i.e. 1/72 of an inch.
// FidoCadJ has a 200 dpi internal resolution.
g.drawString(btoken.toString(),xc,
y-(int)Math.round(
exponentLevel*fontSize*getSizeMultLevel()
/200*72*0.1*g.getZoom()));
exponentLevel*fontSize*getSizeMultLevel()*0.5));
xc+=g.getStringWidth(btoken.toString());
break;
case EXPONENT:
Expand Down
Expand Up @@ -315,7 +315,7 @@ public void setFont(String name, double size)
*/
public double getFontSize()
{
return f.getSize();
return f.getSize()*fontScale;
}

/** Set the font size.
Expand Down

0 comments on commit 6686640

Please sign in to comment.