Releases: tommyettinger/textratypist
2.2.13 "Fix Bigger"
This release includes several new fixes, as well as being the first release on GitHub in a while. You can check README.md for release notes on the 2.2.x series, but there haven't been many breaking changes. Changes in 2.2.13 include...
- Correctly sizing text using
[%400]scale syntax with centered or right alignment. TypingConfig.setDefaultInitialText(String)allows setting a default token for all TextraLabels and TypingLabels (empty by default).- LanaPixel and Cozette have improved metrics, so underline, strikethrough, and so on work with them now.
- Distance field fonts no longer create a ShaderProgram per Font, instead sharing compatible shaders in KnownFonts' singleton.
- The Texture Array Batches from Hyperlap2D have been brought into TextraTypist, with some support code to allow using distance field shaders with them.
There are many more changes if you go back to 2.2.6, the last release I put on GitHub... check the README.md for that, please!
These releases only include the JARs, not any font resources or emoji/icon atlases from KnownFonts. Get the fonts you need from the links in Javadocs for fonts in KnownFonts, or browse the knownFonts/ folder. This release prefers .json.lzma or .fnt fonts, along with their .png images, but other formats used in the past are still supported.
2.2.6 "Human After All"
This is the latest release in the 2.2.x line (which uses libGDX 1.14.0), and it matches the features of 2.1.10 in the 2.1.x line (which uses libGDX 1.13.1). The last 2.2.x release published on GitHub was... 2.2.1... so there's some new content to cover.
- A main change is that large amounts of TextraLabels should load much more quickly, and put less stress on the rendering at runtime, because they aren't constantly needing layout (every frame) anymore.
- TextraButton and TypingButton had a bug fixed where they used their tint color, but applied it twice, resulting in often a much darker color than expected.
- Creating Fonts from BitmapFonts had a number of changes, mostly to make them use the same size now when both are loaded from an FWSkin.
- If you use a BitmapFont created in Hiero with an outline or drop shadow, you can now call the static
Font.setPaddingForBitmapFont()before the Font constructor to compensate for how Hiero (and gdx-tools in general) handles outlines and padding differently than other AngelCode BMFont file generators.
- If you use a BitmapFont created in Hiero with an outline or drop shadow, you can now call the static
- There were changes made to how the backgrounds and labels are drawn in TextraListBox and TextraSelectBox, as well as their Typing variants.
- Small Caps mode should line up the lower-case letters correctly on the baseline now.
- Creating a Font from a .fnt, .json, or BitmapFont should work now if the space character is missing, as long as it can rely on lower-case
'l'being available to guess at the correct width for a space (this matches the behavior of BitmapFont). - A crashing bug when an ellipsis was present has also been fixed.
- Loading .fnt files from subdirectories (without needing KnownFonts) should work now when the image is referenced from the .fnt file.
- This worked before when the image was given separately, such as via a TextureRegion loaded from an atlas, but now allows just the .fnt to be loaded and have its .png get loaded from a "sibling" FileHandle in the same folder.
- There is also, finally, now a Font constructor that only takes one FileHandle for a .fnt file. This is a pretty common use case, even if the structured JSON fonts are probably "better" for their metrics, because Hiero can do various effects on a .fnt file, but not structured JSON.
That should be everything! Thanks to lucas-viva and michaeloa for reporting a number of significant issues and helping resolve them.
Enjoy!
2.1.6 "Backport to the Future"
This brings a variety of recent fixes back to the 2.1.x line (which uses libGDX 1.13.1). It also gets a preview of two fixes that haven't yet made it into the 2.2.x line, related to justified text that affects spaces only, and loading .ubj files (which won't work in libGDX 1.13.1 on GWT, but now will on other platforms). This includes a major improvement to large TextraLabels that prevents them from requiring wrapping every frame (which likely slowed them down a lot; TypingLabel was unaffected); that is also present in 2.2.1 and newer releases. The fixes in 2.2.1 are here also, including the curly brace escape and the fix for TextureAtlases with multiple Texture pages.
2.2.1 "There's a Jack-O-Lantern Emoji! 🎃"
Just in time for Halloween, All Saints' Day, Dia de los Muertos, and various other special autumn occasions, we have a new release, loaded with sweet, tasty... bug fixes. Because I didn't post release notes for 2.2.0, this also includes 2.2.0's update to libGDX 1.14.0, which fills the basket to overflowing with a wide variety of bug fixes, and only some breaking changes!
Bugs fixed in TextraTypist with this update:
Font.addAtlas()with a multi-texture Atlas should work well now, when it didn't always work before.- In
TypingLabel, escaping an opening curly brace using{{works (again, or for the first time, it isn't clear). That causes a single opening curly brace to be shown, and doesn't start parsing an effect. It also doesn't hamper word wrapping, which was a real issue before. If you have an invalid effect tag, such as"incomplete {rainbow text", it is still not a valid situation to display, and that case might just display "incomplete ", but as soon as you close the tag it should parse it and ignore any tags it doesn't know. In this case,{rainbow}would be recognized, but{rainbow text}would not.
That's it for 2.2.1! It's a small release. 2.2.0 mostly consisted of changes for the handful of deprecations in libGDX, such as the Array constructor that takes a Class getting deprecated in favor of one that takes a method reference. There's still some deprecated code present, but it's limited to TextraField and related to changes to Pools; TextraField is still far from ready for usage. A major change in libGDX 1.14.0 was the removal of the libGDX StringBuilder in favor of either CharArray (which has been updated and now has equivalent features) or the JDK StringBuilder (which is generally faster, but doesn't do the same things).
Using Maven Central for dependencies is, as always, preferred to getting the JARs from the releases by hand, but if you do need JARs, you should also get RegExodus 0.1.19 and libGDX 1.14.0 .
2.1.1 "Copy That"
2.1.1 is a single-issue bugfix for 2.1.0, and is identical to 2.1.0 except for a fix to the Font copy constructor so it actually copies all fields it should copy. Following are the release notes for 2.1.0, with the section about the previously-known-bug updated. You should use 2.1.1 instead of 2.1.0 .
This release adds some long-awaited features! Scaling now can make any glyph any size, from close to 0% all the way up to arbitrarily large sizes, with any float in between as an option too! The syntax [%150] can now handle much more than just multiples of 25%, and can do things like [%111.234] without breaking a sweat. This change is associated with the previous "special modes," which before couldn't be used at the same time as a scale factor, and now they can.
Because [%?black outline] was so commonly used in earlier versions, it has been made into a standard type of markup, making it so a black outline can be toggled on any text, with or without modes or scaling, using [#] . There are ways to change the color of the outline using modes. Now the new syntax for modes is available alongside the older syntax for compatibility; you can use [?shadow] to enable drop shadow mode, in addition to the older [%?shadow] and [%^shadow] modes. Now small caps mode isn't allowed to overlap with other modes (black outline takes its place as the overlap-capable "mode-like state"), so [%^shadow] acts the same as [?shadow] or [%?shadow].
There are also quite a few new modes! In addition to black and white outline modes, there are blue, red, and yellow outlines possible, with the option to change their colors per-font. There are two new "fancy underline" modes, context and suggest, which use green slashes and gray angles, respectively. There are the new neon and halo modes, as well, which make the text white or black (respectively) and use the usual text color to form a partly-transparent "glowing" area around each letter. For these last two, if the text color is red, neon mode makes a red glow around white text (something like a neon tube in a sign), and halo mode makes a red glow around black text.
Justified text is a new experimental feature, and is mostly meant for use with TextraLabel (not so much TypingLabel at this point). You can set the justification setting on a Layout, like label.layout.setJustification(Justify.SPACES_ON_PARAGRAPH), then call Font.justify(Layout) at some time after the label has its final targetWidth set (which can be set by scene2d.ui's widget sizing code).
TypingLabel can now appendText() after it has finished its animation, which starts up the animation again for the new content. This was one of the more-requested features, so hopefully it works to everyone's satisfaction!
Material Design icons are available to put into your Fonts using methods in KnownFonts. These are nice productivity-oriented icons from Google and Android.
Several annoying bugs have been fixed. Now scaled text tries to keep the same baseline as non-scaled text, which helps readability. Unicode characters after 0xF800 no longer have a mysterious blue fancy underline for no clear reason. There are some known minor bugs here, which should get fixed rather soon (the copy constructor doesn't copy some configuration done per-Font, for one thing). (EDIT: this has been fixed!) Major bugs are also always a possibility. Allocations of Float values have been sharply reduced at runtime, but if your code is allocating Font objects, you should really be using FWSkin and Styles types instead of creating Fonts from BitmapFonts repeatedly.
OK, that's a lot. I hope it works well for you!
2.1.0 "A La Mode"
This release adds some long-awaited features! Scaling now can make any glyph any size, from close to 0% all the way up to arbitrarily large sizes, with any float in between as an option too! The syntax [%150] can now handle much more than just multiples of 25%, and can do things like [%111.234] without breaking a sweat. This change is associated with the previous "special modes," which before couldn't be used at the same time as a scale factor, and now they can.
Because [%?black outline] was so commonly used in earlier versions, it has been made into a standard type of markup, making it so a black outline can be toggled on any text, with or without modes or scaling, using [#] . There are ways to change the color of the outline using modes. Now the new syntax for modes is available alongside the older syntax for compatibility; you can use [?shadow] to enable drop shadow mode, in addition to the older [%?shadow] and [%^shadow] modes. Now small caps mode isn't allowed to overlap with other modes (black outline takes its place as the overlap-capable "mode-like state"), so [%^shadow] acts the same as [?shadow] or [%?shadow].
There are also quite a few new modes! In addition to black and white outline modes, there are blue, red, and yellow outlines possible, with the option to change their colors per-font. There are two new "fancy underline" modes, context and suggest, which use green slashes and gray angles, respectively. There are the new neon and halo modes, as well, which make the text white or black (respectively) and use the usual text color to form a partly-transparent "glowing" area around each letter. For these last two, if the text color is red, neon mode makes a red glow around white text (something like a neon tube in a sign), and halo mode makes a red glow around black text.
Justified text is a new experimental feature, and is mostly meant for use with TextraLabel (not so much TypingLabel at this point). You can set the justification setting on a Layout, like label.layout.setJustification(Justify.SPACES_ON_PARAGRAPH), then call Font.justify(Layout) at some time after the label has its final targetWidth set (which can be set by scene2d.ui's widget sizing code).
TypingLabel can now appendText() after it has finished its animation, which starts up the animation again for the new content. This was one of the more-requested features, so hopefully it works to everyone's satisfaction!
Material Design icons are available to put into your Fonts using methods in KnownFonts. These are nice productivity-oriented icons from Google and Android.
Several annoying bugs have been fixed. Now scaled text tries to keep the same baseline as non-scaled text, which helps readability. Unicode characters after 0xF800 no longer have a mysterious blue fancy underline for no clear reason. There are some known minor bugs here, which should get fixed rather soon (the copy constructor doesn't copy some configuration done per-Font, for one thing). Major bugs are also always a possibility. Allocations of Float values have been sharply reduced at runtime, but if your code is allocating Font objects, you should really be using FWSkin and Styles types instead of creating Fonts from BitmapFonts repeatedly.
OK, that's a lot. I hope it works well for you!
2.0.0 "The Best Config Is No Config"
This release was a long time in the making, but I'm proud of it where it stands and fairly confident that it should work better now than before. There are a lot of changes here, but mostly the ones that affect users are improvements. There is much less configuration required for most fonts in the default case, and this also applies to emoji and other inline atlases. Usually, if you're using a .dat font from KnownFonts or anything generated by FontWriter, no config should be needed for those fonts; just use a constructor for Font that takes a jsonName by String or jsonHandle by FileHandle, and has an ignoredStructuredJsonFlag parameter. You can also load the Font automatically using FWSkin, given a skin.json file that reads in a BitmapFont from any supported file type. There's more configuration possible (smoothly, even!) for oblique, bold, and outline strengths, among other changes to Font. Compatibility with GWT has improved by avoiding Gdx.files.local() wherever possible, so even if a file isn't found it won't halt GWT apps, but will likely throw an Exception. There's a lot of features here from the last six months or more, so enjoy!
This depends on RegExodus 0.1.17 and libGDX 1.13.1, if you aren't using Gradle to get this as a normal dependency. Please use Gradle, or Maven, or something to manage your build. I make GDX-Liftoff so Gradle is easier to work with libGDX projects, for crying out loud!
Full Changelog: v1.1.0...v2.0.0
1.1.0 "Deselected Tofu"
This release adds a few new things in various places, including more effects for TypingLabel and another option for emoji.
New effects include Meet, Zipper, and Slam. Meet positions chars at a random far-away position and moves them into their target positions as if they are meeting up. Zipper is similar, but simply alternates chars sliding in from above and from below. Slam starts chars above their target position, and quickly moves them into their target position, where they can shake briefly.
On the same topic, the Javadocs have been drastically improved for all effects! Now the parameters an effect expects, and the order they can be provided in, are written out for all effects and should be in the class Javadocs for every effect. The formatting could still use some work, but the information is all there, which it wasn't before. Docs for effects are here.
Noto Color Emoji are new, and are a more detailed, "rich" looking set of emoji that use their full-color nature heavily. You can add Noto emoji to an existing font using KnownFonts.addNotoEmoji(). The existing Twemoji may look better in a simpler or more symbolic set of graphics (they would look much better than Noto in a cel-shaded game, for instance), and the existing OpenMoji have line-art as an option when you really want them to look like text. All of these are now options. You do need the appropriate files for whatever emoji you want to add, as described in the KnownFonts Javadocs.
There's now SelectBox widgets for TextraLabel and TypingLabel items, and since these can display icons/emoji from their font, this (finally) lets you have an icon for each entry in a SelectBox.
There's also [3 files you can copy into a vanilla libGDX project](src\test\java\com\github\tommyettinger\fontwriter) in order to load the .dat or .json files produced by FontWriter, even without an actual dependency on TextraTypist. These may go in their own dependency at some point.
That's about it, for a month's work or so! Enjoy!
1.0.0 "How Big? DAT Big."
This release is a really significant one! 1.0.0 ! About 10 and a half months since the last release, sorry about that! So, what's new...
The knownFonts/ folder is almost completely different now, and you should download any fonts you took from KnownFonts again. But this time, only a few are .fnt ! Most are .dat files, with a similar .png file associated and of course a license file you should distribute. These .dat files are compressed .json files, with the compression a somewhat-rudimentary LZ-based binary type that's GWT-compatible. The main advantage of these fonts is that they can be produced consistently, without needing significant adaptation per-font, descent fiddling, underline stretching, strikethrough shifting, and so on differently for each font. We also have a standard, msdf, and sdf version for every .dat font! You can still download the old .fnt fonts from https://github.com/tommyettinger/fonts , but you can make fonts for the future (as .json or .dat, which behave the same here pretty much) using https://github.com/tommyettinger/fontwriter . Unfortunately, fontwriter is windows-only for now, unless someone wants to build its main dependency, msdf-atlas-gen , for MacOS and/or Linux. Thankfully, .fnt files still work if that's all you can make, plus there are more .dat fonts here to use without building anything.
FWSkin is new! This is an extended Skin that loads both .fnt files and .dat/.json files produced by fontwriter (hence the FW). You can also load FreeType fonts in a Skin .json using FreeTypist, which is like the FreeTypeSkin from the Stripe library, but extending FWSkin instead of just Skin. FWSkin and its relatives load normal libGDX skin.json files, including loading the normal scene2d.ui styles, but they create Font objects whenever they create BitmapFont objects, and also create styles for TextraTypist widgets (which are nested in the Styles class here) when they create styles for scene2d.ui widgets. If you are using Skin now, you should be able to instantly drop in FWSkin in its place, or FreeTypistSkin if you need FreeType support. FreeTypist is just two files, so you don't really need the .jar files here, and can just copy the two source files if you want...
There are an alternate set of emoji, including one using line art instead of full-color, from OpenMoji. There are a few new fonts, such as the dark medieval-looking Grenze, and more variants on DejaVu Sans and Serif. There's a TextraLabel-based ListBox, which corresponds to scene2d.ui List, and allows putting emoji or other icons into ListBox items. (A SelectBox should be possible soon). When curly-brace markup such as {EFFECT} isn't a valid option (such as in I18N files), you can use [-EFFECT] to mean the same thing. Distance field font crispness should be much better, especially if you resize the distance fields using the current Viewport when resize() gets called. If crispness is a problem, you can always set a distance field font's crispness with Font.setCrispness(float), such as to 0.5f for softer edges or 2.0f for harder ones.
There's probably more I'm forgetting. There were lots of small bug-fixes enacted when I went through every test and updated them, but it's also possible something wasn't sufficiently tested and a bug snuck through. That's for a later release! Enjoy the new features now, though!
0.10.0 "Point Break"
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:
boxDrawingBreadthto 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
INSTANTeffect 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!