Answers the font that is defined in the current style. If the font is just a string, then find the font and answer it. Answers the default font, if the font name cannot be found. >>> from pagebot.contexts import getContext >>> context = getContext() >>> bs =
(self)
| 931 | hyphenation = property(_get_hyphenation, _set_hyphenation) |
| 932 | |
| 933 | def _get_font(self): |
| 934 | """Answers the font that is defined in the current style. If the font |
| 935 | is just a string, then find the font and answer it. Answers the default |
| 936 | font, if the font name cannot be found. |
| 937 | |
| 938 | >>> from pagebot.contexts import getContext |
| 939 | >>> context = getContext() |
| 940 | >>> bs = BabelString('ABCD', dict(font='PageBot-Regular'), context=context) |
| 941 | >>> bs.font |
| 942 | <Font PageBot-Regular> |
| 943 | >>> bs.font = 'Roboto-Regular' |
| 944 | >>> bs.font # Answer the new defined Font instance |
| 945 | <Font Roboto-Regular> |
| 946 | >>> bs = BabelString('ABCD', context=context) |
| 947 | >>> bs.font, isinstance(bs.font, Font) # Default font instance |
| 948 | (<Font PageBot-Regular>, True) |
| 949 | """ |
| 950 | return self.getFont() |
| 951 | |
| 952 | def _set_font(self, font): |
| 953 | assert isinstance(font, (str, Font)) |