GithubHelp home page GithubHelp logo

cdave1 / freetype2-ios Goto Github PK

View Code? Open in Web Editor NEW
130.0 7.0 44.0 782 KB

An Xcode project file that can be used to build the Freetype 2 project for iOS

C++ 7.85% C 91.65% Shell 0.01% Makefile 0.50%

freetype2-ios's Introduction

Freetype 2 Xcode Project

This is simply a distribution of the Freetype 2 library, that includes an Xcode project ready to build the Freetype 2 library into a static binary for the iOS operating system.

The motivation for releasing this project is that the cmake generator does not generate a correct Xcode project file for the Freetype project. It took me a number of hours to arrange this Xcode project so that it would compile without error, so hopefully Xcode project this will be useful to others.

The project only includes the Freetype modules for processing TrueType and OpenType fonts. Other font modules have been disabled. If you want to re-enable these modules, you will need to download the Freetype 2 source code, and then copy the module source files to the appropriate location in either the "include/" or "src/" folders of this distribution. The Freetype source code is available here. The instructions for including these new modules in the Xcode project is left as an exercise, but if you follow the pattern of the truetype module in the Xcode project, your module should compile correctly.

The code in this distribution comes from version 2.4.4 of the Freetype library.

Install

You can add the project file to the workspace of an existing project by dragging freetype2.xcodeproj to the appropriate place in Xcode. You then will need to link your target with the libFreetype2.a static library. Consult the documentation for your version of Xcode for instructions on how to do this.

You can also use the "install.sh" script. This script will create a universal fat binary for the i386, armv6 and armv7 architectures. You can then drag the resulting libFreetype.a static library to the open Xcode project you want to use the Freetype library in.

From there, you will need to tell you target project where the Freetype 2 headers are located. For this, you will need to add a recursive link to the "include/" path of this Freetype source code distribution, to the "Header Search Paths" entry of your Xcode project. The "Header Search Path" entry needs to be relative to the target project's location on your file system.

License

This code is distributed under the terms of the Freetype License. The Freetype License is also included in this distribution. If you are going to use code in this project, please make sure you follow the instructions in the Freetype License.

freetype2-ios's People

Contributors

cdave1 avatar karimnaaji avatar maddanio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

freetype2-ios's Issues

XCode: Apple Mach-O Linker Error

Hi there,

I successfully downloaded the git repository, and modified the ".c" modules selected for compilation in the XCode project's Build Phases (as per "INSTALL.ANY"). I also modified the "ftoption.h" header file in the "include" directory, disabling any options related to features that I would not be using.

The project built correctly, and I was able to copy the product into another XCode project. I also added the "include" directory to my project's "Header Search Paths" variable in "Build Settings".

However, when trying to build the dependent project, I get the following errors:

Undefined symbols for architecture i386:
"_FT_Bitmap_Convert", referenced from:
_tt_face_load_sbit_image in libFreetype2.a(sfnt.o)
"_FT_Bitmap_Done", referenced from:
_tt_face_load_sbit_image in libFreetype2.a(sfnt.o)
"_FT_Bitmap_New", referenced from:
_tt_face_load_sbit_image in libFreetype2.a(sfnt.o)
"_FT_Gzip_Uncompress", referenced from:
_sfnt_init_face in libFreetype2.a(sfnt.o)
"_bdf_driver_class", referenced from:
_ft_default_modules in libFreetype2.a(ftinit.o)
"_pcf_driver_class", referenced from:
_ft_default_modules in libFreetype2.a(ftinit.o)
"_pfr_driver_class", referenced from:
_ft_default_modules in libFreetype2.a(ftinit.o)
"_psaux_module_class", referenced from:
_ft_default_modules in libFreetype2.a(ftinit.o)
"_t1_driver_class", referenced from:
_ft_default_modules in libFreetype2.a(ftinit.o)
"_t1cid_driver_class", referenced from:
_ft_default_modules in libFreetype2.a(ftinit.o)
"_t42_driver_class", referenced from:
_ft_default_modules in libFreetype2.a(ftinit.o)
"_winfnt_driver_class", referenced from:
_ft_default_modules in libFreetype2.a(ftinit.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I notice that these errors contain the names of modules that I have disabled, by removing their respective ".c" files from compilation in the "freetype2-ios" project.

Was there some other configuration required in that project, to disable references to these disabled modules?

Any help greatly appreciated.

Thanks for looking.

How to include the "include" and "src" folder in the project?

Hello,

I try to build the library Freetype for IOS from the latest build 2.6. I have added "include" and "src" in the "Header Search Path". But the headers are not showed in "Build Phases > Headers > Project". Please help how to add these 2 folders.

Thank you!

#error = face->goto_table( face, TTAG_hdmx, stream, &table_size );

I have a error. when i build a iOS progam by armv64.
i cant pass .
My error log :
1833502800(lldb) thread backtrace

  • thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x112c50000)
    frame #0: 0x0000000112c50000
    • frame #1: 0x00000001030d4c90 testmantt_face_init [inlined] tt_face_load_hdmx(face=0x0000000105812600, stream=0x00000002819edf40) at ttpload.c:510:11 [opt] frame #2: 0x00000001030d4c70 testmantt_face_init(stream=0x00000002819edf40, ttface=0x0000000105812600, face_index=0, num_params=, params=) at ttobjs.c:574 [opt]
      frame #3: 0x00000001030ce09c testmanopen_face(driver=0x0000000281488180, astream=0x000000016d4909a8, external_stream=<unavailable>, face_index=0, num_params=0, params=0x0000000000000000, aface=0x000000016d4909a0) at ftobjs.c:1177:15 [opt] frame #4: 0x00000001030cdb34 testmanFT_Open_Face(library=0x0000000105779a40, args=0x000000016d490a10, face_index=0, aface=0x000000016d490a68) at ftobjs.c:2194:16 [opt]
      frame #5: 0x00000001030cd93c testmanFT_New_Face(library=<unavailable>, pathname=<unavailable>, face_index=<unavailable>, aface=<unavailable>) at ftobjs.c:0:12 [opt] frame #6: 0x00000001029d75b8 testmanFreeTypeFont::FreeTypeFont(this=0x000000016d490b50, code=L'S', font_file="/var/mobile/Containers/Data/Application/36F27E47-B7E6-476A-9DF5-57DAAE817C65/Documents/TextFirework/STXINWEI.TTF") at FreeTypeFont.h:0 [opt]
      frame #7: 0x00000001029d7d98 testmanSJVFontMesh::GetMesh(char const*, char const*, sjv_font_data**, int*) [inlined] FreeTypeFont::FreeTypeFont(this=<unavailable>, code=<unavailable>, font_file=<unavailable>) at FreeTypeFont.h:187:1 [opt] frame #8: 0x00000001029d7d8c testmanSJVFontMesh::GetMesh(this=0x0000000106183b60, font_file=, text=, font_data=0x000000016d490cf0, char_count=0x000000016d490cfc) at sjv_mobile_text3d_impl.cpp:78 [opt]
      frame #9: 0x00000001030e2c94 testman::st_text_3d_api_sjv_mobile_text3d_get_mesh_mBDC79EEE78E2E3130877A44D59EB745A52DAEA04(___handle0=<unavailable>, ___fontfile1=<unavailable>, ___text2=<unavailable>, ___font_data3=<unavailable>, ___char_count4=<unavailable>, method=<unavailable>) at Assembly-CSharp.cpp:7422:24 [opt] frame #10: 0x00000001030e46c0 testman::Text3DFireworkPlayer_PlayPartitcle_mB751D7993E6F15F88F8DE39CD7F813B5329A1F15(Text3DFireworkPlayer_tE063438646623E4E1902E7B4B2128C65F1929B0B *, const RuntimeMethod *) at Assembly-CSharp.cpp:7362:17 [opt]
      frame #11: 0x00000001030e46a8 testman::Text3DFireworkPlayer_PlayPartitcle_mB751D7993E6F15F88F8DE39CD7F813B5329A1F15(__this=0x0000000109a01f00, method=<unavailable>) at Assembly-CSharp.cpp:8432 [opt] frame #12: 0x00000001030e457c testman::Text3DFireworkPlayer_OnGUI_m68E2C2AFB5CB9AF2C7E41A4769CCC65A586C4937(__this=0x0000000109a01f00, method=) at Assembly-CSharp.cpp:8379:3 [opt]
      frame #13: 0x00000001029b1464 testmanRuntimeInvoker_TrueVoid_t22962CB4C05B1D89B55A6E1139F0E87A90987017(methodPointer=<unavailable>, methodMetadata=<unavailable>, obj=<unavailable>, args=<unavailable>)(), MethodInfo const*, void*, void**) at Il2CppInvokerTable.cpp:8524:2 [opt] frame #14: 0x00000001030ad684 testmanil2cpp::vm::Runtime::Invoke(method=0x00000001068496f0, obj=0x0000000109a01f00, params=, exc=0x000000016d490fc0) at Runtime.cpp:542:35 [opt]
      frame #15: 0x0000000102d742dc testman::scripting_method_invoke() at ScriptingApi_Il2Cpp.cpp:249:48 [opt] frame #16: 0x0000000102d7d74c testman::Invoke() at ScriptingInvocation.cpp:273:23 [opt]
      frame #17: 0x0000000102af2264 testman::MonoBehaviourDoGUI() [inlined] Invoke at ScriptingInvocation.h:69:74 [opt] frame #18: 0x0000000102af2254 testman::MonoBehaviourDoGUI() at MonoBehaviourDoGUI.cpp:25 [opt]
      frame #19: 0x0000000102af00bc testman::DoGUI() at GUIManager.h:83:20 [opt] frame #20: 0x0000000102aefa14 testman::DoGUIEvent() at GUIManager.cpp:376:32 [opt]
      frame #21: 0x0000000102aefe54 testman::SendQueuedEvents() at GUIManager.cpp:159:14 [opt] frame #22: 0x0000000102ce88e0 testman::ExecutePlayerLoop() at PlayerLoop.cpp:281:21 [opt]
      frame #23: 0x0000000102ce8914 testman::ExecutePlayerLoop() at PlayerLoop.cpp:298:17 [opt] frame #24: 0x0000000102ce8afc testman::PlayerLoop() at PlayerLoop.cpp:354:5 [opt]
      frame #25: 0x0000000102ec3cc4 testmanUnityPlayerLoopImpl at LibEntryPoint.mm:0:9 [opt] frame #26: 0x0000000102978d34 testmanUnityRepaint at UnityAppController+Rendering.mm:276:9 [opt]
      frame #27: 0x0000000102978c20 testman-[UnityAppController(self=0x00000002814b7680, _cmd=<unavailable>) repaintDisplayLink] at UnityAppController+Rendering.mm:71:9 [opt] frame #28: 0x00000001056417c4 GPUToolsCore-[DYDisplayLinkInterposer forwardDisplayLinkCallback:] + 168
      frame #29: 0x00000001a7cf8fac QuartzCoreCA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 516 frame #30: 0x00000001a2283650 IOKitIODispatchCalloutFromCFMessage + 480
      frame #31: 0x00000001a1289b34 CoreFoundation__CFMachPortPerform + 172 frame #32: 0x00000001a12b3174 CoreFoundationCFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 56
      frame #33: 0x00000001a12b2880 CoreFoundation__CFRunLoopDoSource1 + 444 frame #34: 0x00000001a12ad634 CoreFoundation__CFRunLoopRun + 1888
      frame #35: 0x00000001a12acba8 CoreFoundationCFRunLoopRunSpecific + 424 frame #36: 0x00000001ab41c344 GraphicsServicesGSEventRunModal + 160
      frame #37: 0x00000001a53e83e4 UIKitCoreUIApplicationMain + 1932 frame #38: 0x0000000102972300 testmanmain(argc=1, argv=0x000000016d493830) at main.mm:41:9 [opt]
      frame #39: 0x00000001a11348f0 libdyld.dylib`start + 4

Tested on FT 2.9.1+?

Hi! Is this project still active? If so, I made various changes to the CMake files in FT 2.9.1 and master. I'd love to know if that makes things work for you.

generalize install.sh

Hi,

you are specifying 8.1 as target os versions in install.sh. if you just drop the version it should do the right thing, at least here (were it picked 10.2 automatically).

thanks for providing this!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.