在UIWebView iOS 4.2.1中的阿拉伯语TTF(TrueType字体) [英] Arabic TTF (TrueType font) in UIWebView iOS 4.2.1

查看:187
本文介绍了在UIWebView iOS 4.2.1中的阿拉伯语TTF(TrueType字体)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好
我想在UIWebView中使用自定义阿拉伯字体,我读到iOS 4.2以上,我们可以使用TTF网络字体。

Hi I want to use custom arabic font in UIWebView, I read that iOS 4.2 onwards we can use TTF webfonts.

我有阿拉伯字体我的资源和以下是我使用的代码:

I have arabic font in my resources and following is the code I am using:

<html>
    <head>
        <title>@font-face Demo</title>
        <style type="text/css">
            @font-face {
                font-family: 'me_quran Regular';
                src: local('me_quran Regular'), 
                            local('me_quran'), 
                            url('me_quran.ttf') format('truetype');

            }


            h1, p {
                font-family: 'me_quran Regular';
            }
            h1 {
                font-size: 45px;
            }
            p {
                font-size: 18px;
                line-height: 27px;
            }
            #container{
                width: 800px;
                margin: 0 auto 0 auto;
            }

            }

        </style>
    </head>
    <body>
        <div id="container">
            <h1>بِسْمِ ٱللَّهِ ٱلرَّحْمَٰنِ ٱلرَّحِيمِ</h1>

            <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
        </div>
    </body>
</html>

问题是:我在UIWebView中得到阿拉伯文本,但它不是我加载的, iOS使用的默认阿拉伯字体。

The problem is: I am getting the arabic text in UIWebView but its not the one I loaded, its the default arabic font iOS uses.

帮助我!
注意:我测试过许多英语TTF,它们都在iOS 4.2.1上正常工作。

Help me out! Note: I have tested many English TTF, they all are working fine with iOS 4.2.1.

推荐答案


我终于弄明白了。您可以加载几乎所有(.ttf)字体,阿拉伯语,英语或任何在上面的iOS 3.2。你只需要使用正确的文本(根据unicode),以显示它。

Hi I finally figured it out. You can load almost all (.ttf) fonts, either arabic, english or whatever on iOS 3.2 above. You just need to use the correct text (in terms of unicode), to display it.

这篇关于在UIWebView iOS 4.2.1中的阿拉伯语TTF(TrueType字体)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆