wideioltd / unity3d-ttftext

TTF Text Rendering for Unity3d
Other
40 stars 15 forks source link

Not Compatible with unity 5 #1

Open eastes opened 9 years ago

eastes commented 9 years ago

I tried a while to figure out how to get this to work with Unity 5. I didn't have luck fixing any compile errors unfortunately.

bnouvel-wio commented 9 years ago

Hi eastes,

The code has been open-sourced to allow the community to maintain and update the project that has remained unmaintained for more than a year. It had been initially released in 2012. I am aware that some other developers are currently trying to update and fix the project. Hopefully, ttf-text they'll be update to push their fixes, the repo will be compatible with unity 5 soon.

yqf3139 commented 8 years ago

I fond the current version support Unity 5.3.3f1 32 bit Windows Editor. However, I got into troubles when I try to use the 64 bit version Unity. I build the freetype248.dll 64 bit binary but regenerate the mesh, it is always an empty mesh. I am working on the problem and hope someone have a 64 bit solution.

appearance commented 8 years ago

Hi guys, Any news about this works on Unity 5.3.x (iOS). It was crashing when I upgraded my 4.7 project to Unity 5.3.x.

AdamFrisby commented 6 years ago

I've managed to get freetype 2.4.8 recompiled under 64-bit for this; however actually using it is a regular crash fest. I'm going to try swap FTSharp with a more standard freetype port for C#, that hopefully will resolve the issue.

AdamFrisby commented 6 years ago

OK, so another attempt at compiling freetype, and recompiling FTSharp against this is making progress, however there appears to be a key error in Outline.FlattenGlyph -

Watching it being called from Font.cs (GetGlyphOutline(...)), it appears slotrec contains the glyph information correctly (yay), however as soon as it passes through Outline.FlattenGlyph the points are removed; looking into that function, it it binds a bunch of functions in OutlineDecomposer which should call back into managed code.

It looks like the callbacks never occur, so the error is somewhere in the C#<->Freetype interop code relating to outline decomposition.

AdamFrisby commented 6 years ago

I think I found at least a big part of this - in freetype, the basic unit is FT_Pos (re-used in FT_Vector and such), however in the FSharp library, it is defined as a int --- in freetype this is a signed long.

Annoyingly, MSVC defines a long as 32-bit in 32-bit, and 64-bit in 64-bit, unlike an int. I suspect I'm starting to get somewhere (still not working after recompiling freetype with this defined as a int.)

patrickscheper commented 5 years ago

I'm guessing there's no update or possibility to make this work with Unity 2018. Does anyone have alternatives?

AdamFrisby commented 5 years ago

I had a good chat with @bnouvel-wio a few months ago about getting it working - he put some patches in a branch which helped, but unfortunately I wasn't able to get it quite working. I am still keen to work on this further; this was the best TTF plugin for Unity, paid or not, even now.

AdamFrisby commented 5 years ago

My gut says though - the right thing is to switch from using freetype for the curve generation, and use one of the pure-C# libraries which can generate the curves, then feed it back into ttftext. I had a prototype of that working about 6-9 months ago - but the data was inputting wrong and I didn't have the patience to figure it out at the time.