View Single Post
Old 08-04-2007, 12:34 PM   #34
swr2408018
Enthusiast
swr2408018 will become famous soon enoughswr2408018 will become famous soon enoughswr2408018 will become famous soon enoughswr2408018 will become famous soon enoughswr2408018 will become famous soon enoughswr2408018 will become famous soon enough
 
Posts: 35
Karma: 501
Join Date: Jul 2007
Device: PRS-500
pylrs bug with TextBlock(textstyle,blockstyle,blockattr=value)?

When I specify a blockstyle attribute in a TextBlock(), it doesn't appear to have any effect. (I can work around this by creating a new blockstyle with the change.)

It doesn't look like the code does anything with those "overriding" values. E.g.:

self.textSettings = {}
self.blockSettings = {}
for name, value in settings.items():
if name in TextStyle.validSettings:
self.textSettings[name] = value
elif name in BlockStyle.validSettings:
self.blockSettings[name] = value
else:
raise LrsError, "%s not a valid setting for TextBlock" % name

captures the override values in either self.textSettings or self.blockSettings as appropriate, and then

self.textStyle = textStyle
self.blockStyle = blockStyle

# create a textStyle with our current text settings (for Span to find)
self.currentTextStyle = textStyle.copy()
self.currentTextStyle.attrs.update(self.textSettin gs)

copies overriding textStyle values into the currentTextStyle, but there is nothing similar for the overriding blockStyle values.

Am I missing something here?

Thanks!

Steve
swr2408018 is offline   Reply With Quote