开发者

how to use ORIYA font in smart device development?

I am developing an application for WINDOWS CE5.0 based device. It requires ORIYA language(INDIAN REGIONAL LANGUAGE) to be used completely. As visua开发者_Python百科l studio use ENGLISH as standard language, please tell me how to proceed? I tried to copy the font in WINDOWS CE device's WINDOWS/FONTS folder but as i restart the device that font file disappears. I developed the application in c# and changed labels text into oriyaa in Development system. It looks fine on the development system but as i deployed it into device, All label text appears in ENGLISH. I dont know whats happening? I also need to set the LABEL.TEXT property in ORIYA language. Is it possible? How to take user input in ORIYA? Please help..... Thanks...


Not very sure as what you meant by browser but for the Forms you can go about using PrivateFontCollection

you can load the font from a folder in your app and then use AddFontFile or AddMemoryFont as per your need. So now the Client can see the controls in the font you set and its available to it irrespective of its installed or not


I have used the following approach with English-based fonts, but I am not sure if it will work on your case. The original source of this approach is a nice post from Chris Tacke (SO user @ctacke) with some modifications.

    [DllImport("coredll.dll")]
    private static extern int AddFontResource(string lpszFilename);
    [DllImport("coredll.dll", SetLastError = true)]
    private static extern int SendMessage(IntPtr hWnd, int wMsg, IntPtr wParam, IntPtr lParam);
    static IntPtr HWND_BROADCAST = (IntPtr)0xFFFF;
    const int WM_Fontchange = 0x001D;

    private static void RegisterFont(string aFontPath, string aTargetFontPath)
    {
        IntPtr thir = (IntPtr)0;
        IntPtr fourth = (IntPtr)0;
        try
        {
            if (!System.IO.File.Exists(aTargetFontPath))
                System.IO.File.Copy(aFontPath, aFontTargetPath);
        }
        catch { throw; }
        int _Loaded = AddFontResource(aFontTargetPath);
        if (_Loaded != 0)
            SendMessage(HWND_BROADCAST, WM_Fontchange, thir, fourth);
    }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜