mirror of
https://github.com/octoleo/plantuml.git
synced 2024-11-20 04:00:53 +00:00
Merge pull request #721 from matthew16550/font-test
Fix broken A000*_Test tests on macOS
This commit is contained in:
commit
f718c59a15
@ -57,7 +57,7 @@ public class UFont {
|
|||||||
|
|
||||||
public String toStringDebug() {
|
public String toStringDebug() {
|
||||||
final StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
sb.append(font.getFontName());
|
sb.append(getPortableFontName());
|
||||||
sb.append("/");
|
sb.append("/");
|
||||||
sb.append(font.getSize());
|
sb.append(font.getSize());
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
@ -168,6 +168,20 @@ public class UFont {
|
|||||||
return family;
|
return family;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Kludge for testing because font names on some machines (only macOS?) do not end with <DOT><STYLE>
|
||||||
|
// See https://github.com/plantuml/plantuml/issues/720
|
||||||
|
private String getPortableFontName() {
|
||||||
|
final String name = font.getFontName();
|
||||||
|
if (font.isBold() && font.isItalic())
|
||||||
|
return name.endsWith(".bolditalic") ? name : name + ".bolditalic";
|
||||||
|
else if (font.isBold())
|
||||||
|
return name.endsWith(".bold") ? name : name + ".bold";
|
||||||
|
else if (font.isItalic())
|
||||||
|
return name.endsWith(".italic") ? name : name + ".italic";
|
||||||
|
else
|
||||||
|
return name.endsWith(".plain") ? name : name + ".plain";
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return font.toString()/* + " " + font.getPSName() */;
|
return font.toString()/* + " " + font.getPSName() */;
|
||||||
|
Loading…
Reference in New Issue
Block a user