Recent

Author Topic: FreeType on Android  (Read 18409 times)

jmpessoa

  • Hero Member
  • *****
  • Posts: 2318
FreeType on Android
« on: September 02, 2013, 06:38:19 am »
Hi there!

I got this messages/logs

"C:\laz4android\fpc\2.7.1\bin\i386-win32\arm-linux-androideabi-ld.exe: cannot find -lfreetype"

 "error: Error while linking"

when I tried use these units: FTFont, freetype, freetypeh on my android module (.so).

Anyone know how to cross-compile the FreeType library stuff for Android using the TrueTom package laz4android1.1-41139?

Thank you!
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

Leledumbo

  • Hero Member
  • *****
  • Posts: 8783
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: FreeType on Android
« Reply #1 on: September 03, 2013, 05:06:15 pm »
Quote
Anyone know how to cross-compile the FreeType library stuff for Android using the TrueTom package laz4android1.1-41139?
Build the freetype library for your android and put the .so along with your app .so or drop dependency to freetype library by using native Pascal freetype implementation.

jmpessoa

  • Hero Member
  • *****
  • Posts: 2318
Re: FreeType on Android
« Reply #2 on: September 03, 2013, 08:23:45 pm »
Hi Leledumbo,

1. The main question:  How to
cross-compile the FreeType library stuff for Android using the TrueTom package laz4android1.1-41139 ( I need this for compatibility)

At the moment I do not know to do this ...  :'(

2.Alternative question: Is LazFreeType LCL dependent (or not) ?

Thank you very much!
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

Leledumbo

  • Hero Member
  • *****
  • Posts: 8783
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: FreeType on Android
« Reply #3 on: September 04, 2013, 04:57:09 pm »
Quote
1. The main question:  How to
cross-compile the FreeType library stuff for Android using the TrueTom package laz4android1.1-41139 ( I need this for compatibility)
Got Android NDK? Got FreeType source code? Build the source code using NDK toolchain (the source code should have instruction how to do it). FreeType is written in C, so you'll need a C compiler (and probably a bunch of other libraries it depends on) to build.
Quote
2.Alternative question: Is LazFreeType LCL dependent (or not) ?
Seems not (see attached screenshot, from PasViz output)

jmpessoa

  • Hero Member
  • *****
  • Posts: 2318
Re: FreeType on Android
« Reply #4 on: September 04, 2013, 08:05:21 pm »
Thank you! I am will try LazFreeType!
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

jmpessoa

  • Hero Member
  • *****
  • Posts: 2318
Re: FreeType on Android
« Reply #5 on: September 08, 2013, 08:18:09 pm »
Hi there!

from https://github.com/cdave1/freetype2-android
(and small changes to produce a SHARED_LIBRARY)

I got  cross-compile the FreeType library stuff for Android and
bind with free pascal stuff (FTFont, freetype, freetypeh)!

Yes, we can run fcl-image + freetype on Android!

thanks to all!
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

jmpessoa

  • Hero Member
  • *****
  • Posts: 2318
Re: FreeType on Android
« Reply #6 on: September 10, 2013, 05:34:08 am »
Hi there!

Follows a picture (attached) showing a small example of
my attempt to bring Free Pascal  fci-image + freetype to play on Android....

Greetings!





Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

jmpessoa

  • Hero Member
  • *****
  • Posts: 2318
Re: FreeType on Android
« Reply #7 on: December 29, 2013, 04:54:57 pm »
@Sergionn

follow my "primitive "investigations in using freetype2 lib on android...

I - How to build a freetype ".so" for Android... on Windows.
 
  I.1- You have to install e configure MinGW (32 bits)  to cross compile "C" stuff to Android...

  I.2- I got from https://github.com/cdave1/freetype2-android the freetype "C" stuff...  and build a Eclipse project  with small changes in
"Android.mk"  and  "Application.mk" to produce a SHARED_LIBRARY...

  :: My Eclipse Project to make "FreeType" is here:

     http://jmpessoa.opendrive.com/files?Ml8zNzY0NTA2Ml8zcWZTRA

   ::After (un)rar:

 -> open the project with Eclipse and "right click" -> Properties
 -> Edit: Builder -> Freetype_builder .... to you paths....
 -> Run!
 -> Open \libs\armeabi and \libs\armeabi-v7a
      Yes!  "libfreetype.so"  are there!

II. Using the new "libfreetype.so"

    - Just create a project and put the "libfreetype.so" in
        \libs\armeabi   (or: \libs\armeabi-v7a) !
 
     :: My Eclipse "Demo "Project is here:

        http://jmpessoa.opendrive.com/files?Ml8zNzY0Njk5Ml9BbnQ4Yw   

Good luck!
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

Sergionn

  • New member
  • *
  • Posts: 8
Re: FreeType on Android
« Reply #8 on: December 29, 2013, 07:05:39 pm »
Jmpessoa, Thanks a lot!!!

jmpessoa

  • Hero Member
  • *****
  • Posts: 2318
Re: FreeType on Android
« Reply #9 on: December 30, 2013, 06:34:45 pm »
Hi,

@Sergionn,

I forgot to tell you.  The "libfreetype.so" that you got from  my "primitive" investigations was built for platform "android-8". Please, change the Android.mk"  and  "Application.mk" to produce a SHARED_LIBRARY for other platform, ex. "android-14"...

Thank you.
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

lenz

  • New Member
  • *
  • Posts: 17
Re: FreeType on Android
« Reply #10 on: December 30, 2013, 09:16:26 pm »
This is great work! I'll get my hands dirty with FreeType now. :)

As a small note, what I understood is that you should use the most recent Android NDK version for building and for run-time, it will remain compatible with lower OS versions. I'm compiling everything using NDK-R9B (and will soon try R9C) without any issues and it works on devices from KitKat down to Gingerbread.

Another note, I wouldn't suggest targeting Android-8 at all because Froyo doesn't support native activities and is very scarce anyway. In my case, I had to switch ROMs on my Galaxy Pro to Gingerbread (before it had Froyo) just to be able to run anything on it.

jmpessoa

  • Hero Member
  • *****
  • Posts: 2318
Re: FreeType on Android
« Reply #11 on: December 30, 2013, 09:33:46 pm »
@lenz

Yes, 

This example was built for "android-8" platform,   but this is outdated now....

Please, change "Application.mk"  file.

Thank you.
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

 

TinyPortal © 2005-2018