public TTFTextOutline GetGlyphOutline(object parameters, object font, char c) { #if UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_EDITOR Font fnt = (Font)font; FTSharp.Outline.Point adv = new FTSharp.Outline.Point(); FTSharp.Outline ol = fnt.font.GetGlyphOutline(c); if (fnt.reversed) { return(new TTFTextOutline(ol, adv, true)); } else { return(new TTFTextOutline(ol, adv, false)); } #else return(null); #endif }
/// This function simply uses Freetype to get an outline /// it used by other engines.. public static TTFTextOutline MakeNativeOutline (string txt, float charSpacing, float embold, TTF.Font font, bool reversed, int interpolationstep ) { TTFTextOutline o = null; #if !TTFTEXT_LITE #if UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_EDITOR TTF.Outline.Point tadv = new TTF.Outline.Point(); TTF.Outline ttfoutline = font.GetStringOutline( txt, ref tadv, TTF.HorizontalJustification.Origin, TTF.VerticalJustification.Origin , false, charSpacing, 0, interpolationstep); o= TTFTextOutline.TTF2Outline(ttfoutline, tadv,reversed).Embolden(embold); #endif #endif return o; }
public TTFTextOutline GetGlyphOutline(object parameters,object font, char c) { #if UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX|| UNITY_EDITOR Font fnt=(Font)font; FTSharp.Outline.Point adv=new FTSharp.Outline.Point(); FTSharp.Outline ol=fnt.font.GetGlyphOutline(c); if (fnt.reversed) { return new TTFTextOutline(ol,adv,true); } else { return new TTFTextOutline(ol,adv,false); } #else return null; #endif }