Skip to content

0.10.0 "Point Break"

Compare
Choose a tag to compare
@tommyettinger tommyettinger released this 31 Aug 22:21
· 474 commits to main since this release

This is a pretty big release, in large part due to a fix for #12 , which necessitated a breaking change, but also allowed some extra new features. The change is mostly that [] must be replaced with [ ] to maintain the same behavior as earlier versions of TextraTypist, or you can now use [] in the same way it is used by BitmapFont (to undo one previous level of square-bracket markup). If you encounter bugs with this release (such as line height behavior being wrong), try switching existing [] to [ ] first. The BitmapFont-style [] hasn't been tested as thoroughly but does at least seem to work in narrow circumstances; it may have problems if you try to use [] to "undo" markup when none has been encountered before.

Oh yeah, the new features! The main one is that you can store the current formatting state by assigning it to a label, and load that formatting state later. Storing uses the syntax [(label)], where label can be any String without square brackets but is by convention one word, and loading uses the syntax [ label], with a space before the label String (like how [ ] with no String loads the default format). This has more uses than it might seem at first! An example is if you color text by the character speaking it, but want to interject some note with a different color and/or style in the middle of the spoken text. For example, let's say you have the bold-face villain monologue [dark dull red][*]NONE SHALL STAND BEFORE ME! GENERIC HERO TEAM, YOU SHALL RUE THE DAY YOU CROSSED THE BRUTAL VALXEGAAR! and you want to insert a Wikipedia-style superscript note like [BLUE][^][[[/]dubious - discuss[/]]. If you just inserted the Wikipedia note into the middle of the monologue String, then the blue text and superscript style would last after the note is over, which would make the second sentence the wrong color (and it would be a superscript). If you changed the note to reset the colors and styles at the end, like [BLUE][^][[[/]dubious - discuss[/]][ ], then the superscript style wouldn't be a problem, but the second sentence would use the default color for the Layout or label... which is probably not [dark dull red] unless most sentences are shouted by The Brutal Valxegaar. The new solution is to store the state of the formatting coming into the inserted text, optionally to reset the styles within the insert, to print the insert as normal, and to load the stored state at the end of the insert. This doesn't change the monologue text at all, but does change the insert: [(previous)][ ][BLUE][^][[[/]dubious - discuss[/]][ previous] . This will correctly display the first and last sentences in bold red text, and will have the note in the traditional Wikipedia superscript style.

Other new features include:

  • boxDrawingBreadth to configure how wide lines should be when used for box drawing (and the lines are drawn using the gridGlyphs feature that uses a stretched square to align box sections).
  • The INSTANT effect will cause a section of text to appear all at once. It is roughly equivalent to setting the text speed to infinite and then setting it back after the section is over, except that INSTANT doesn't affect the text speed after it ends (it goes back to whatever the speed was before the INSTANT effect).

Bugs fixed include:

  • #13 appears fixed, depending on if you are using TextraLabel or calling pack() (then it works) or using TypingLabel without setting the boundaries with a Table cell or Container (then it does not). This bug affects or affected wrapping when multiple whitespace characters would have extended past a newline, so some need to be wrapped.
  • User "Antz" and I fixed a strange bug with the initial text passed to a TypingLabel constructor not acting how setText() or restart() would. This bug was very hard to pin down, with the incorrect behavior manifesting in many ways, but it should be fully resolved now.

You shouldn't need to update any of knownFonts this time, unless you are updating from a version earlier than 0.9.0 .

OK, good luck with this one! I expect 5 million bug reports by next week! You have your quota!