test_fontutil.py 852 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
import unittest
from unittests import wtc
import wx
import os

#---------------------------------------------------------------------------

class fontutil_Tests(wtc.WidgetTestCase):

    def test_fontutil(self):
        f1 = wx.FFont(12, wx.FONTFAMILY_SWISS)
        i1 = f1.GetNativeFontInfo()
        st = i1.ToString()

        i2 = wx.NativeFontInfo()
        i2.FromString(st)
        f2 = wx.Font(i2)
        self.assertTrue(f1 == f2)

    def test_fontutilProperties(self):
        nfi = wx.NativeFontInfo()
        nfi.InitFromFont(wx.NORMAL_FONT)
        nfi.Encoding
        nfi.FaceName
        nfi.Family
        nfi.PointSize
        #nfi.PixelSize
        nfi.Style
        nfi.Underlined
        nfi.Weight



#---------------------------------------------------------------------------


if __name__ == '__main__':
    unittest.main()