• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python pyfribidi.log2vis函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pyfribidi.log2vis函数的典型用法代码示例。如果您正苦于以下问题:Python log2vis函数的具体用法?Python log2vis怎么用?Python log2vis使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了log2vis函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: biditext_cb

def biditext_cb(data, modifier, modifier_data, line):
    # We assume a tab separates the nick from the text
    text = line.split('\t', 1)
    if len(text) > 1:
        text[1] = log2vis(text[1], ON)
        return '\t'.join(text)

    return line
开发者ID:spacepluk,项目名称:weechat-biditext,代码行数:8,代码来源:biditext.py


示例2: format

 def format(self, item):
     '''
     item is of type EmployeeSalary
     '''
     val = ''
     sales = item.sales
     for project, sales in sales:
         val += log2vis("%s - %s" % (project, len(sales))) + '<br/>'
     return val
开发者ID:eladr07,项目名称:NiceHouse,代码行数:9,代码来源:salary_table_fields.py


示例3: testBigString

    def testBigString(self):
        """ unicode: big string

        It does not make sense to order such big strings, this just
        checks that there are no size limits in pyfribidi.
        """
        # About 2MB string for default python build (ucs2)
        big = (u'א' * 1024) * 1024
        self.assertEqual(pyfribidi.log2vis(big), big)
开发者ID:nirs,项目名称:pyfribidi,代码行数:9,代码来源:test_pyfribidi.py


示例4: _formatText

 def _formatText(self, text):
     "Generates PDF text output operator(s)"
     text = pyfribidi.log2vis(text, RTL)
     if self._dynamicFont:
         results = []
         font = pdfmetrics.getFont(self._fontname)
         for subset, chunk in font.splitString(text, self._canvas._doc):
             if subset != self._curSubset:
                 pdffontname = font.getSubsetInternalName(subset, self._canvas._doc)
                 results.append("%s %s Tf %s TL" % (pdffontname, fp_str(self._fontsize), fp_str(self._leading)))
                 self._curSubset = subset
             chunk = self._canvas._escape(chunk)
             results.append("(%s) Tj" % chunk)
         return string.join(results, ' ')
     else:
         text = self._canvas._escape(text)
         return "(%s) Tj" % text
开发者ID:eaudeweb,项目名称:naaya.semide,代码行数:17,代码来源:textobjectRTL.py


示例5: testNoReorderNonSpacingMarks

 def testNoReorderNonSpacingMarks(self):
     """unicode: reorder non spacing marks"""
     self.assertEqual(pyfribidi.log2vis(u"חַיְפַא", RTL, reordernsm=False),
                      u"אַפְיַח"
                      )
开发者ID:pediapress,项目名称:pyfribidi,代码行数:5,代码来源:test_pyfribidi.py


示例6: testEmpty

 def testEmpty(self):
     """ unicode: empty string """
     self.assertEqual(pyfribidi.log2vis(u''), u'')
开发者ID:nirs,项目名称:pyfribidi,代码行数:3,代码来源:test_pyfribidi.py


示例7: testUTF16NaturalRTL

 def testUTF16NaturalRTL(self):
     """ other encodings: utf-16 """
     charset = 'utf-16'
     self.assertEqual(pyfribidi.log2vis(u"שלום - hello".encode(charset),
                                        encoding=charset),
                      u"hello - םולש".encode(charset))
开发者ID:nirs,项目名称:pyfribidi,代码行数:6,代码来源:test_pyfribidi.py


示例8: testCp1255NaturalRTL

 def testCp1255NaturalRTL(self):
     """ other encodings: cp1255 """
     charset = 'cp1255'
     self.assertEqual(pyfribidi.log2vis(u"שלום - hello".encode(charset),
                                        encoding=charset),
                      u"hello - םולש".encode(charset))
开发者ID:nirs,项目名称:pyfribidi,代码行数:6,代码来源:test_pyfribidi.py


示例9: testIso8859_8NaturalRTL

 def testIso8859_8NaturalRTL(self):
     """ other encodings: iso8859-8 """
     charset = 'iso8859-8'
     self.assertEqual(pyfribidi.log2vis(u"שלום - hello".encode(charset),
                                        encoding=charset),
                      u"hello - םולש".encode(charset))
开发者ID:nirs,项目名称:pyfribidi,代码行数:6,代码来源:test_pyfribidi.py


示例10: prep_arabic

def prep_arabic(string):
    '''Prepares strings with arabic in them for being printed to the terminal
    '''
    return pyfribidi.log2vis(string)
开发者ID:bmaupin,项目名称:android-arabic-flashcards,代码行数:4,代码来源:cards.py


示例11: testNaturalRTL

 def testNaturalRTL(self):
     """ unicode: reorder RTL line by natural order """
     self.assertEqual(pyfribidi.log2vis(u"שלום - hello", ON),
                      u"hello - םולש")
开发者ID:nirs,项目名称:pyfribidi,代码行数:4,代码来源:test_pyfribidi.py


示例12: testAsLTR

 def testAsLTR(self):
     """ unicode: reorder line as LTR """
     self.assertEqual(pyfribidi.log2vis(u"hello - שלום", LTR),
                      u"hello - םולש")
开发者ID:nirs,项目名称:pyfribidi,代码行数:4,代码来源:test_pyfribidi.py


示例13: testDefaultDirection

 def testDefaultDirection(self):
     """ unicode: use RTL default """
     self.assertEqual(pyfribidi.log2vis(u"hello - שלום"),
                      pyfribidi.log2vis(u"hello - שלום", RTL))
开发者ID:nirs,项目名称:pyfribidi,代码行数:4,代码来源:test_pyfribidi.py


示例14: test_glibc_free_invalid_next_size

 def test_glibc_free_invalid_next_size(self):
     # *** glibc detected *** /home/ralf/py27/bin/python2: free(): invalid next size (fast): 0x00000000011cff00 ***
     pyfribidi.log2vis('\xf0\x90\x8e\xa2\xf0\x90\x8e\xaf\xf0\x90\x8e\xb4\xf0\x90\x8e\xa1\xf0\x90\x8f\x83')
开发者ID:pediapress,项目名称:pyfribidi,代码行数:3,代码来源:test_pyfribidi.py


示例15: bidi

 def bidi(s,enabled=DEFAULT_BIDI):
     if not enabled: return s
     return log2vis(s,base_direction=LTR)
开发者ID:thedod,项目名称:twigi,代码行数:3,代码来源:twigi.py


示例16: visualizeIfUnicode

def visualizeIfUnicode(s):
    return pyfribidi.log2vis(s, base_direction=pyfribidi.ON
            ).decode('utf-8')
开发者ID:kenanpelit,项目名称:vim-cmus,代码行数:3,代码来源:cmus.py


示例17: on_button_clicked

def on_button_clicked(obj):
	inText = clip.wait_for_text()
	outText = pyfribidi.log2vis (inText, pyfribidi.ON)
	clip.set_text(outText)
开发者ID:nirs,项目名称:pyfribidi,代码行数:4,代码来源:fribidi_systray.py


示例18: biditext_cb

def biditext_cb(data, modifier, modifier_data, line):
    return log2vis(line, LTR)
开发者ID:yuvallanger,项目名称:weechat-biditext,代码行数:2,代码来源:biditext.py


示例19: testAsRTL

 def testAsRTL(self):
     """ unicode: reorder line as RTL """
     self.assertEqual(pyfribidi.log2vis(u"hello - שלום", RTL),
                      u"םולש - hello")
开发者ID:nirs,项目名称:pyfribidi,代码行数:4,代码来源:test_pyfribidi.py


示例20: testReorderNonSpacingMarks

 def testReorderNonSpacingMarks(self):
     """unicode: reorder non spacing marks"""
     self.assertEqual(pyfribidi.log2vis(u"חַיְפַא", RTL),
                      u"אפַיְחַ"
                      )
开发者ID:pediapress,项目名称:pyfribidi,代码行数:5,代码来源:test_pyfribidi.py



注:本文中的pyfribidi.log2vis函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python db.session函数代码示例发布时间:2022-05-25
下一篇:
Python mpiutil.get_comm_rank_root函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap