Skip to content

Commit

Permalink
Also move the lines based on descent.
Browse files Browse the repository at this point in the history
  • Loading branch information
tommyettinger committed May 20, 2024
1 parent b85d133 commit dc41592
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ org.gradle.daemon=true
org.gradle.configureondemand=false
gdxVersion=1.12.1
regexodusVersion=0.1.15
anim8Version=0.4.2
anim8Version=0.4.3

SONATYPE_HOST=DEFAULT
RELEASE_SIGNING_ENABLED=false
Expand Down
13 changes: 7 additions & 6 deletions src/main/java/com/github/tommyettinger/textra/Font.java
Original file line number Diff line number Diff line change
Expand Up @@ -2184,16 +2184,17 @@ else if("sdf".equals(dfType) || "psdf".equals(dfType)) {
float ascender = atlas.getFloat("ascender", 0.8f);
descent = size * atlas.getFloat("descender", -0.25f);
originalCellHeight = cellHeight = size * atlas.getFloat("lineHeight", 1f) + heightAdjust - descent;
underY = atlas.getFloat("underlineY", -0.1f);
strikeBreadth = underBreadth = atlas.getFloat("underlineThickness", 0.05f);
underY = atlas.getFloat("underlineY", -0.1f) - descent / size;
strikeBreadth = underBreadth = atlas.getFloat("underlineThickness", 0.25f);
if(makeGridGlyphs){
underLength = strikeLength = 0.2f;
underX = strikeX = -0.1f;
underLength = strikeLength = 0.05f;
underX = strikeX = -0.05f;
} else {
underLength = strikeLength = 0.0f;
underX = strikeX = -0.4f;
underX = strikeX = 0.0f;
}
fancyY = 0.0f;
fancyY = -descent / size;
strikeY = -0.5f * descent / size;

// strikeY = ascender * 0.5f;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public void changed (ChangeEvent event, Actor actor) {
fpsLabel = new TypingLabel("fps: 0 [^][SKY][[citation needed]", skin, "title", title);
fpsLabel.setAlignment(Align.topLeft);
// configures an example of a TextField in password mode.
passwordLabel = new TypingLabel("Textfield in [~]secure[ ] password mode [+ninja][+ninja][+ninja]: ", skin, "title", font);
passwordLabel = new TypingLabel("[_]Textfield in [~]secure[ ] [%?error]password mode [+ninja][+ninja][+ninja]: ", skin, "title", font);
final TextField passwordTextField = new TextField("", skin);
passwordTextField.setMessageText("password");
passwordTextField.setPasswordCharacter('*');
Expand Down

0 comments on commit dc41592

Please sign in to comment.