当前位置: 首页>>代码示例>>Python>>正文


Python pyfribidi.log2vis函数代码示例

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


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


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