-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Font with shadows crashes #9
Comments
Please create a minimal runnable example. |
Well, it is a very basic asset manager class: public class Assets {
private final AssetDescriptor<FreeTypeFontGenerator> mTextFontDesc = new AssetDescriptor<FreeTypeFontGenerator>("font/Mecha_Bold.ttf", FreeTypeFontGenerator.class);
private AssetManager mAssetManager;
public Label.LabelStyle mMainTitleFontStyle;
public Assets() {
mAssetManager = new AssetManager();
mAssetManager.setLoader(FreeTypeFontGenerator.class, new FreeTypeFontGeneratorLoader(new InternalFileHandleResolver()));
mAssetManager.setLoader(BitmapFont.class, ".ttf", new FreetypeFontLoader(new InternalFileHandleResolver()));
}
public void createAssets() {
//Skip all other assets
createFonts();
}
private void createFonts() {
FreeTypeFontGenerator.setMaxTextureSize(1024);
FreeTypeFontGenerator fontGenerator = mAssetManager.get(mTextFontDesc);
FreeTypeFontGenerator.FreeTypeFontParameter fontParameter;
BitmapFont font;
fontParameter = new FreeTypeFontGenerator.FreeTypeFontParameter();
fontParameter.size = 64;
//fontParameter.shadowColor = Color.BLACK;
//fontParameter.shadowOffsetX = 6;
//fontParameter.shadowOffsetY = 6;
fontParameter.genMipMaps = true;
fontParameter.minFilter = Texture.TextureFilter.MipMapLinearNearest;
fontParameter.magFilter = Texture.TextureFilter.MipMapLinearNearest;
font = fontGenerator.generateFont(fontParameter);
font.setUseIntegerPositions(true);
mMainTitleFontStyle = new Label.LabelStyle(font, new Color(0xf9f901ff));
}
public void dispose() {
mAssetManager.dispose();
}
public boolean update() {
return mAssetManager.update();
}
} Just create a new instance of |
I can confirm that stuff explodes when shadow is set to something. |
That's great to know that stuff explodes when shadows are used. |
Not very useful, I'm aware. Sadly the exception seems to occur in the freetype.js code which makes it hard to debug. |
@piotr-j do you by chance have a runnable and web accessible gwt version? |
Ill make one today. Is there more readable |
Runnable http://piotrjastrzebski.io/gwt-freetype-test/ |
Please try the new version "1.9.10.1" when it has reached maven central. Using your test it works. |
|
I told eclipse to compile gwt using Closing as fixed. |
When I set shadow parameters in
FreeTypeFontParameter
the app crashes.Here is a sample code:
If I uncomment any of
shadow
parameter GWT application crashes with the following error:Error: java.lang.RuntimeException: java.lang.ClassCastException
.I'm really confused about that.. what could be the cause?
The text was updated successfully, but these errors were encountered: