Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upFix freetype font loading when using AndroidZipFile #3475
Merged
Conversation
backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidZipFileHandle.java
Outdated
| @@ -84,7 +84,7 @@ public FileHandle child(String name) { | |||
| public FileHandle sibling(String name) { | |||
| if (file.getPath().length() == 0) | |||
| throw new GdxRuntimeException("Cannot get the sibling of the root."); | |||
| return new AndroidZipFileHandle(new File(file.getParent(), name), type); | |||
| return Gdx.files.internal(file.getParent() + "/" + name); //this way we can find the sibling even if it's not inside the obb | |||
This comment has been minimized.
This comment has been minimized.
MobiDevelop
Oct 9, 2015
Member
Perhaps Gdx.files.getFileHandle(new File(file.getParent(), name).getPath(), type); instead.
This comment has been minimized.
This comment has been minimized.
sarkanyi
Oct 9, 2015
Author
Contributor
Type should always be Internal in case of AndroidZipFiles, but can do if you think.
This comment has been minimized.
This comment has been minimized.
MobiDevelop
Oct 9, 2015
Member
I'd prefer to not make the assumption in case at some point we decide we need to have some other file type that better suits this.
MobiDevelop
added a commit
that referenced
this pull request
Oct 9, 2015
Fix freetype font loading when using AndroidZipFile
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
sarkanyi commentedOct 9, 2015
FreeType fonts look for the sibling of a file, which in case of AndroidZipFile might be in the internal rather the obb file itself. This patch fixes this case and also adds a test inside the APKExpansionTest.