-
Notifications
You must be signed in to change notification settings - Fork 109
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
Usage on Android #122
Comments
You build freetype for android, using the android NDK. |
Yup, I ship pre-built FreeType dll's on Windows since it needs patching on 64-bit. Android uses FreeType internally but doesn't expose it to apps, so you'll have to build your own. Here's a fairly specific guide that should still work despite the dated NDK version: https://en.wikibooks.org/wiki/OpenGL_Programming/Installation/Android_NDK#FreeType Plenty of other guides/articles/repos show up if you look |
Alright thanks, i'll look into this. The problem i had when initially searching was that i just could not find anything that related to FreeType, Android AND Xamarin. As it stands, i don't really find anything for Xamarin + NDK, but i have been able to install NDK. Using it however is proving to be a headache and seems to require to a lot of jumping around :/ Not that is an issue with SharpFont of course. |
I've since hit a wall. I cross-compiled freetype but now have no idea how to use it.. |
If you cross compile correctly you should end up with a |
I see. So i have an issue that that straight up doesn't exist for me after following the provided link, i'll have a further look around though. Fairly sure i cross-compiled it, just hasn't produced any .so files so perhaps not. |
If you have libtool on your system, the outcome might be hidden in `obj/.libs` (note the ".").
Look at the result of ./configure (or the equivalent) and make sure that it says shared library is supported/selected. If it isn't, your build system is not complete.
|
Ah yes i seem to have been blind. There is 'libfreetype.so' within my compiled folder as well as my uncompiled freetype. Woops. Will close once confirmed working. |
So it seems i didn't have any 'libfrreetype.so.[X]' but do have one without the number. I added this to my project in /lib/armeabi/ and set it's build action to AndroidNativeLibrary. I still get a crash on the first call inside my DLL that complains about not finding libfreetype.so.6. I had a go about going into the SharpFont.dll.config file and making it look for just libfreetype but this of course did not work. I have given dropping the libfreetype.so file into the output directory of both my DLL (/bin/Release) and my Android Application (/bin/Debug) where SharpFont.dll is dumped on build, but this hasn't worked either. The only thing i found in my freetype build was pkgconfig which didn't say anything about a shared library, and couldn't find any directory or file name configure or config. (EDIT) |
I re-tried my process again, based on the link provided again. as per this documentation. |
How do i go about using this in an Android Xamarin app? I have it working for a Windows Application if i copy out one of the packaged freetype dll's to the output directory, but this isn't so simple on Android.
On Android i get a crash when trying to instantiate the Library object:
System.DllNotFoundException: libfreetype.so.6
Help appreciated.
The text was updated successfully, but these errors were encountered: