Allow ruby text to inherit its color from parent text.

Fixes #5418
This commit is contained in:
Tom Rothamel
2024-04-16 22:23:39 -04:00
parent f855f8367c
commit 378950f633
4 changed files with 12 additions and 2 deletions
+2 -2
View File
@@ -239,8 +239,8 @@ class TextSegment(object):
self.underline = 0
self.strikethrough = layout.scale_int(style.strikethrough)
self.color = style.color
self.black_color = style.black_color
self.color = style.color or self.color
self.black_color = style.black_color or self.black_color
self.hyperlink = None
self.kerning = layout.scale(style.kerning)
self.outline_color = None
+3
View File
@@ -40,6 +40,9 @@ purposes.
Features
--------
:ref:`Ruby/Furigana text <ruby-text>` can now inherit its color from the parent text,
by setting :propref:`color` to None.
Transform now supports the :tpref:`fps` property, which quantizes time inside
the transform to a particular number of frames per second.
+6
View File
@@ -478,6 +478,9 @@ Text Style Properties
When rendering an image-based font, black will be mapped to this
color. This has no effect for TrueType fonts.
This may be None in the case of ruby/furigana text, to use the same
color as the parent text.
.. style-property:: bold boolean
If True, render the font in a bold style. For a TrueType font,
@@ -497,6 +500,9 @@ Text Style Properties
the font is rendered in this color. When using an image-based
font, white is mapped to this color.
This may be None in the case of ruby/furigana text, to use the same
color as the parent text.
.. style-property:: emoji_font string
The font that's used to render Emoji characters. This is automatically
+1
View File
@@ -619,6 +619,7 @@ For example::
style ruby_style is default:
size 12
yoffset -20
color None # Use the same color as the parent text.
style say_dialogue:
ruby_line_leading 12