//
    public void UpdateClient(TTFText tm)
    {
        // may be used to update the necessary charmap of
        // a font on the fly
        TTFTextFontStoreFont x = GetFont(tm.FontId);

        x.AddRequiredCharacters(x.additionalChar);
        if (x.needRebuild)
        {
            x.BuildCharSet(tm.FontId);
        }
        Debug.LogWarning("Not yet implemented");
    }
    public TTFTextFontStoreFont EnsureFont(string fontid)
    {
        // ensures that a specific font is present the store
        // this function does not update the reference counts

        TTFTextFontStoreFont f = GetFont(fontid);

        if (f == null)
        {
            TTFTextFontStoreFont nf = new TTFTextFontStoreFont();
            if (fontid.Length > 0)
            {
                nf.fontid  = fontid;
                nf.charset = null;
                nf.AddRequiredCharacters(this.defaultAdditionalCharacters);         // addd this
                embeddedFonts.Add(nf);
                f = nf;
#if UNITY_EDITOR
                if (!Application.isPlaying)
                {
                    string d = Application.dataPath;
                    d = System.IO.Path.Combine(d, "Resources");
                    if (!System.IO.Directory.Exists(d))
                    {
                        UnityEditor.AssetDatabase.CreateFolder("Assets", "Resources");
                    }
                    d = System.IO.Path.Combine(d, "TTFText");
                    if (!System.IO.Directory.Exists(d))
                    {
                        UnityEditor.AssetDatabase.CreateFolder("Assets/Resources", "TTFText");
                    }
                    d = System.IO.Path.Combine(d, "Fonts");
                    if (!System.IO.Directory.Exists(d))
                    {
                        UnityEditor.AssetDatabase.CreateFolder("Assets/Resources/TTFText", "Fonts");
                    }
                    f.BuildCharSet(f.fontid);

                    UnityEditor.AssetDatabase.CreateAsset(TTFTextFontStoreFontAsset.CreateInstance <TTFTextFontStoreFontAsset>().Init(f), "Assets/Resources/TTFText/Fonts/" + f.fontid + ".asset");
                    Debug.Log("Font " + f.fontid + " has been embedded");
                }
#endif
            }
        }

        return(f);
    }
    public TTFTextFontStoreFont EnsureFont(string fontid)
    {
        // ensures that a specific font is present the store
        // this function does not update the reference counts

        TTFTextFontStoreFont f = GetFont(fontid);

        if (f==null) {
            TTFTextFontStoreFont nf=new TTFTextFontStoreFont();
            if (fontid.Length>0) {
            nf.fontid=fontid;
            nf.charset=null;
            nf.AddRequiredCharacters(this.defaultAdditionalCharacters); // addd this
            embeddedFonts.Add(nf);
            f=nf;
        #if UNITY_EDITOR
                if (!Application.isPlaying) {
                string d=Application.dataPath;
                d=System.IO.Path.Combine(d,"Resources");
                if (!System.IO.Directory.Exists(d)) {
                        UnityEditor.AssetDatabase.CreateFolder("Assets","Resources");
                }
                d=System.IO.Path.Combine(d,"TTFText");
                if (!System.IO.Directory.Exists(d)) {
                        UnityEditor.AssetDatabase.CreateFolder("Assets/Resources","TTFText");
                }
                d=System.IO.Path.Combine(d,"Fonts");
                if (!System.IO.Directory.Exists(d)) {
                        UnityEditor.AssetDatabase.CreateFolder("Assets/Resources/TTFText","Fonts");
                }
                f.BuildCharSet(f.fontid);

                UnityEditor.AssetDatabase.CreateAsset(TTFTextFontStoreFontAsset.CreateInstance<TTFTextFontStoreFontAsset>().Init(f),"Assets/Resources/TTFText/Fonts/"+f.fontid+".asset");
                Debug.Log("Font "+ f.fontid+ " has been embedded");
                }
        #endif
            }
        }

        return f;
    }
    // this version will block until all character are downloaded...
    public IEnumerable SyncGetOutlineForLetter(string fontid, string characters)
    {
        TTFTextOutline [] res = new TTFTextOutline[characters.Length];
        // for each character

        TTFTextFontStoreFont f = GetFont(fontid);

        if (f == null)
        {
            IEnumerable r = null;
            do
            {
                r = DoSyncDownloadOutline(fontid, f.additionalChar);
                if (r.GetType() == typeof(WaitForSeconds))
                {
                    yield return(r);
                }
            } while (r.GetType() == typeof(WaitForSeconds));
        }

        foreach (char c in characters)
        {
            if (!f.HasCharacter(c))
            {
                f.AddRequiredCharacters(characters);
                IEnumerable r = null;
                do
                {
                    r = DoSyncDownloadOutline(fontid, f.additionalChar);
                    if (r.GetType() == typeof(WaitForSeconds))
                    {
                        yield return(r);
                    }
                } while (r.GetType() == typeof(WaitForSeconds));
            }
        }

        yield return(res);
    }