Hi @Tryder
Curious to know if jme-ttf supports right to left text wrapping?
Hi, @Tryder
I have one more question with TrueTypeBMP.
I notice that there are some differences between TrueTypeAWT
and TrueTypeSfntly
.
In TrueTypeAWT
the atlas texture was disposed whenever atlas was resized.
https://github.com/ATryder/jME-TTF/blob/master/src/com/atr/jme/font/TrueTypeAWT.java#L202
but in TrueTypeSfntly
it was not.
https://github.com/ATryder/jME-TTF/blob/master/src/com/atr/jme/font/TrueTypeSfntly.java#L275
If I donāt lock the atlas neither preload any text, this could happen.
First I use TrueTypeAWT
to make a short String, then I use it to make a long enough String. This operation will force TrueTypeAWT
to resize atlas, which mean the old atlas (already in use) will be killed.
This is my test case.
How about just create a maxResolution texture, and copy BufferedImage to Image with ImageRaster ?
Iām trying to keep the Texture2D and reset Image.
Also provide an fixedResolution
option in TrueTypeKeyBMP
.
And use it to change behavior of TrueTypeBMP#resizeAtlas()
This can solve my problem.
Changes to the atlas texture can be handled through an AtlasListener
. The notes section on the jME-TTF documentation page discuss this, jttf_notes
Example:
AtlasListener atlasListener = new AtlasListener() {
@Override
public void mod(AssetManager assetManager, int oldWidth, int oldHeight,
int newWidth, int newHeight, TrueTypeBMP font) {
//The atlas texture has been modified, update the texture on your text materials to the new atlas texture here.
if (oldWidth != newWidth || oldHeight != newHeight)
//Update your geometries here as the texture has been resized and the UV coordinates have changed. For example TrueTypeContainer.updateGeometry(); or TrueTypeNode.updateGeometry();
}
}
((TrueTypeBMP)ttf).addAtlasListener(atlasListener);
But if you prefer a max resolution feature youāre welcomed to make a pull request.
@Ali_RS , jME-TTF does not support support right to left directionality.
Adam:
- Iām glad youāre still around to answer questions and give advice.
- Attempting to browse the documentation webpage gives me a 404 error.
- I use JME-TTF in my Maud application, so Iād grateful if youād upload the latest release to bintray.com
Yeah, turns out Iām not so easy to get rid of . I fixed the typo in the link, itās jttf. Iāll be starting my winter migration here soon and Iām trying to work up an updated version of my TEdit Android app with some requested new features before I hit the road, but I should be able to squeeze out an updated jME-TTF to bintray in a couple of days.
Thanks for the corrected URL. Safe travels!
Thanks for the well wishes. After some dark clouds rolled in I checked the forecast, looks like a solid week or so of rain so Iām going to have to change that couple of days estimate to an indeterminant amount of time.
Hi, @Tryder
I have made a new pull request. Here is what I have done in this pr:
1. Make the project compatible to Maven and Gradle
- Add build.gradle to the project.
- Add pom.xml to the project
- Move
src
tosrc/main/java
2. Add fixedResolution feature
3. Add some test cases with Ubuntu fonts
Please check my pr.
I havenāt forgotten about this by the way. Itās been too cloudy to bootup my computer and that trend looks to continue for several more days then Iāll spend the next week packing up our gear, loading up the bikes and hittinā the road for winter migration. My girlfriend likes to leave on September 22nd because itās the same day Bilbo and Frodo left on their journeys in The Hobbit and Lord of the Rings . Recently picked up some sweet new shades for the trip to boot. Anyway weāre only going about a hundred miles before taking a month long layover so Iāll probably get a bunch of stuff done then.
groupId: com.atr
artifactId: jme-ttf
version: 2.2.1
Thereās an issue with the POM at JCenter:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
> Could not resolve com.atr:jme-ttf:2.2.1.
Required by:
project :
> Could not resolve com.atr:jme-ttf:2.2.1.
> Could not parse POM https://jcenter.bintray.com/com/atr/jme-ttf/2.2.1/jme-ttf-2.2.1.pom
> Missing required attribute: dependency groupId
Looks like the error is in the final dependency:
<dependency>
<artifactId>android</artifactId>
<scope>compile</scope>
</dependency>
Should be good to go now. I built the pom file from the new gradle build script provided by Yan and the android dependency in the new build script isnāt actually available on jcenter, but was included in the pom file anyway so I removed it.
Confirmed good. Thank you!
I received a PM asking for access to my Lemur Dynamo package and figured Iād post an update here.
Many of the files I share on my website and elsewhere are stored on Google Drive using Share Links. Earlier this year I noticed that virtually all of those links stopped working. Well they worked, but instead of linking directly to the shared file on Google Drive people were instead taken to a Google Account login page where they had to login and request access to the files. Apparently, for some unknown reason, the access to all my linked files had been changed to private.
I donāt know when this happened as all the requests for access to various files were coming into my Google Mail account which I no longer use and I donāt typically go about checking the links I have on my website to make sure they still work because, you know, why wouldnāt they?
Anyway I recreated the share links and everything seems to be working last I checked, but now @icyboxs asks me, via PM here, for access to my Lemur Dynamo package stored on Google Drive. So I went and recreated the link which is now https://drive.google.com/file/d/0B6BscJ4Cq-K7ZUlJakxKZFRiTGs/view?usp=sharing&resourcekey=0-6SW8w8yRubusi3X2iICUNg, but it still doesnāt work. The link takes me to a page saying that the file is in violation of Googleās ToS, although thereās nothing indicating this when I login and look at the file in my Google Drive account.
Iāll post an updated link here when I find somewhere else to upload the file.
P.S. My website is now hosted at https://www.inventati.org/1337gallery. The weebly address still works, but I donāt update the weebly site very often as itās a bit of a pain.
Lemur dynamo on Dropbox: Dropbox - LemurDynamo-v1.02.zip - Simplify your life
Also updated the links on my website which pointed to an older version of jme-ttf: Dropbox - jME-TTF-2.2.2.zip - Simplify your life