Skip to content

Commit

Permalink
Apply again the bad fix to ignore thread errors in bitmap fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
fgnm committed Oct 10, 2023
1 parent 5fd9391 commit 910e453
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
18 changes: 14 additions & 4 deletions src/main/java/games/rednblack/editor/proxy/ResourceManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,18 @@ public void onRegister() {
packer.setTransparentColor(Color.WHITE);
packer.getTransparentColor().a = 0;

FreeTypeFontGenerator dejaVuSansGenerator = new FreeTypeFontGenerator(Gdx.files.internal("freetypefonts/DejaVuSans.ttf"));
FreeTypeFontGenerator monoGenerator = new FreeTypeFontGenerator(Gdx.files.internal("freetypefonts/FiraCode-Regular.ttf"));
FreeTypeFontGenerator dejaVuSansGenerator = new FreeTypeFontGenerator(Gdx.files.internal("freetypefonts/DejaVuSans.ttf")) {
@Override
protected BitmapFont newBitmapFont(BitmapFont.BitmapFontData data, Array<TextureRegion> pageRegions, boolean integer) {
return new ThreadSafeBitmapFont(data, pageRegions, integer);
}
};
FreeTypeFontGenerator monoGenerator = new FreeTypeFontGenerator(Gdx.files.internal("freetypefonts/FiraCode-Regular.ttf")){
@Override
protected BitmapFont newBitmapFont(BitmapFont.BitmapFontData data, Array<TextureRegion> pageRegions, boolean integer) {
return new ThreadSafeBitmapFont(data, pageRegions, integer);
}
};

FreeTypeFontGenerator.FreeTypeFontParameter parameter = new FreeTypeFontGenerator.FreeTypeFontParameter();
parameter.characters += "⌘⇧⌥\u25CF\u2022";
Expand Down Expand Up @@ -126,7 +136,7 @@ public void onRegister() {

dejaVuSansGenerator.dispose();

TextureRegion dejavuRegion = new TextureRegion(new Texture(Gdx.files.internal("style/default-font-32.png")));
/*TextureRegion dejavuRegion = new TextureRegion(new Texture(Gdx.files.internal("style/default-font-32.png")));
ShadedDistanceFieldFont smallDistanceField = new ShadedDistanceFieldFont(Gdx.files.internal("style/default-font-32.fnt"), dejavuRegion);
smallDistanceField.setDistanceFieldSmoothing(6);
smallDistanceField.getData().setScale(0.35f);
Expand All @@ -135,7 +145,7 @@ public void onRegister() {
defaultDistanceField.getData().setScale(0.4f);
ShadedDistanceFieldFont bigDistanceField = new ShadedDistanceFieldFont(Gdx.files.internal("style/default-font-32.fnt"), dejavuRegion);
bigDistanceField.setDistanceFieldSmoothing(6);
bigDistanceField.getData().setScale(0.5f);
bigDistanceField.getData().setScale(0.5f);*/
/* Create the ObjectMap and add the fonts to it */
ObjectMap<String, Object> fontMap = new ObjectMap<>();
fontMap.put("small-font", small);
Expand Down

0 comments on commit 910e453

Please sign in to comment.