textratypist

Augmented text display system for libGDX, based on typing-label

APACHE-2.0 License

Stars
90

Bot releases are visible (Hide)

textratypist - 1.1.0 "Deselected Tofu" Latest Release

Published by tommyettinger 2 months ago

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!

textratypist - 1.0.0 "How Big? DAT Big."

Published by tommyettinger 3 months ago

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!

textratypist - 0.10.0 "Point Break"

Published by tommyettinger about 1 year ago

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!

textratypist - 0.9.0 "Meditation Upon Form"

Published by tommyettinger about 1 year ago

If you include only the changes since the alpha 0.9.0-a3, this is a small release. If you include the changes since the last stable release, 0.8.3, this is a massive release! Changes since 0.8.3 include:

  • You can configure many, many more parts of a font.
    • Bold strength, oblique strength, shadow color, two different outline colors, three fancy underline colors...
    • Various position metrics can be adjusted for underline and strikethrough, including setting both at once.
      • You can change the thickness of these lines now, as well as how far they extend into nearby chars, and their x/y position.
    • A font can specify different positions or size for inline images placed into the font, such as emoji or game icons.
      • Size is a little clumsy; increasing xAdvance shrinks the inline images. Sorry.
  • We now require Java 8 or higher to avoid using so much reflection.
    • This should help Graal Native Image usage.
    • Switching to Java 8 or higher is easy, and the only work is probably only needed for gdx-setup projects.
    • Just change any sourceCompatibility, targetCompatibility, or possibly compileJava.options.release from 1.7, 7, or JavaVersion.VERSION_1_7 to the appropriate form of higher version, which could be 1.8, 8, "8", JavaVersion.VERSION_1_8, or a few other forms. Gradle isn't very consistent about how it describes versions.
      • You will also probably need to change your File -> Project Structure (in IntelliJ IDEA) from using version 7 as the default to using 8 or higher.
  • Some new fonts have been added, like LanaPixel, GoNoto Universal (standard), and Gentium Un-Italic.
    • These are in KnownFonts, as usual.
  • Lots of documentation improvements are here, too!

You should probably re-download any .fnt and .png files you use from KnownFonts, because several changed. Remember to check for Java 8 compatibility before adding TextraTypist as a dependency, because Gradle doesn't give nice error messages when a library needs a different version than what it can provide. Enjoy!

textratypist - 0.9.0-a1 "A Horse With No Name"

Published by tommyettinger over 1 year ago

This is an alpha release! Some things are expected to be broken! If you're willing to test after that warning, there are many new features here. Most of the rotation bugs that persistently popped up in the 0.7.x and 0.8.x series seem to have been resolved. You can now fine-tune the positions of underline, strikethrough, and inline images (such as emoji) separately from other changes to a Font's metrics. There's a vital bugfix for loading emoji and game-icons from inside a JAR. Calling skipToTheEnd() on a TypingLabel or a widget that contains one should now actually skip to the end immediately. There's a new font, Gentium Un-Italic, which takes Gentium Italic's fancy design and removes its 8-degree slant to make it look like a regular face with a different style. There's a new OceanEffect, which is also handy for fire effects, oddly. Many .fnt and .png files have changed, so you should download anything from knownFonts/ again. Previews have been updated.

I'm suspicious of the vertical position and/or size of Fonts created from BitmapFonts, such as almost anything in scene2d.ui by default. If you encounter problems, please report them in the Issues tab or on the libGDX Discord. If the link is broken, as a fallback use this link.

textratypist - 0.8.3 "Stairway To Heaven"

Published by tommyettinger over 1 year ago

This release is small, again, but includes useful fixes, again, and some nice new features... again. A somewhat-rare, but serious, bug can happen in earlier versions when a TypingLabel has wrapping text and an effect that changes its offsets variable. This is fixed now. The vertical position of text with [%200]-style scaling now is centered on the middle of the line, rather than the bottom of the line. This matches how other code expected text to scale, so there's less empty space above and less overlap with other lines below. That feature was made possible by IgorApplications, so thanks! There's a new font here, Kingthings Petrock, which is similar to the existing Kingthings Foundation but is less decorative/ornamented, and more legible as the type of text encountered everyday in (a fantasy version of) medieval times.

textratypist - 0.8.2 "Reset The Reset"

Published by tommyettinger over 1 year ago

This release is very small and sudden! It contains:

  • Improvements to background color size and position,
  • Better emoji/icon/atlas image placement relative to text,
  • A possibly-breaking change with Font.enableShader(), which now does not force the Batch color to white after calling.

Because the last one may require a small change to adapt to, which is just putting batch.setPackedColor(Color.WHITE_FLOAT_BITS); after the call to enableShader() if you encounter issues with color, I figured it was best to get this release out there so code could adapt to it sooner, and any problems with other features can then be isolated to a later (or earlier) release. The position improvements are nice, though.

textratypist - 0.8.1 "Advanced Junkyards and Janitors"

Published by tommyettinger over 1 year ago

This release fixes a bug with word wrapping that was especially annoying in the last release, has a minor fix to behavior when adding multiple atlases to a Font, allows SDF fonts to work with emoji (mostly), adds the massive SDF pan-unicode font Go Noto Universal, and also adds a new {CANNON} effect. Something is almost assuredly still incorrect here, but outside of known bugs in the README, nothing so far is absolutely broken, so... this looks good to me?

textratypist - 0.8.0 "Double Jump"

Published by tommyettinger over 1 year ago

This release exists primarily to fix a variety of small bugs in the releases just before it. It's a pretty wide variety... Hopefully the more detailed configuration options for atlases/emoji/icons, which were added here, should avoid one class of bugs where images look wrong relative to text. Another bug regarding images and text was that scaling up a font moved the letters differently from emoji or other images (this is fixed too). Other issues affected wrapping (which should behave better when a widget changes size), pooling (which is now entirely removed, because of some nasty bugs it could cause), TextraWindow's columns (it had a messed up Table inside), and the "fancy underlines" for error and info mode (which were always red by mistake). There's a new geometric-style font, NowAlt, and over 4000 icons from game-icons.net ! I hope this release is more robust than the last few, but if there are issues, I'll be around to fix them.

textratypist - 0.7.7 "The Finglonger"

Published by tommyettinger over 1 year ago

This release has an assortment of small features and fixes. There's support for and inclusion of MSDFA fonts, using msdf-gdx-gen. There's a few new fonts in KnownFonts -- Gentium MSDF, Yanone Kaffeesatz MSDF, and Yataghan (also MSDF). There's the Font.drawVertices() method that can be overridden to support unusual types of Batch (typically ones with additional attributes). There's various fixes for word wrapping, including unexpected wrapping when a label doesn't have enough width for a word, and the long-standing quirk of \r and \n being treated differently by Font.markup() and Font.regenerateLayout(). Finally, we have the same feature typing-label just added, the {IF} token, which allows conditional replacement of text based on a variable. Lots of stuff! It seems to work well so far, though I'm sure there are bugs somewhere (hopefully small ones).

Have fun with this!

textratypist - 0.7.6 "Crusher Of Bugs"

Published by tommyettinger over 1 year ago

This release brings back GWT compatibility, since GWT projects failed to compile if they used 0.7.5 (whoops). This updated RegExodus to include its GWT fix, then made a few other fixes to position, especially for underline and strikethrough over emoji (or other images). There were actually quite a few things that were improved for positioning, which is why this took a little longer than expected. Thanks, Sandra, for putting up with my lengthy delay after finding the initial problem!

You can configure a Font more thoroughly in its constructor because widthAdjust and heightAdjust work more as-intended now. They shouldn't pull nearby glyphs in the texture into the space of the current glyph anymore.

You can now use TextraTypist with JDK 7 without issues; only the tests actually require Java 8 to run (because they use LWJGL3).

A bug with pooling in the checkbox widgets has been fixed; not all widgets have been checked for their pooling behavior yet, so if you encounter any Line appearing where it should have been deleted, please submit an issue or tell me on the libGDX Discord! I appreciate it.

You should download any .fnt files you use again, and also the Twemoji atlas file if you use that. The names in the Twemoji atlas are cleaner now, with no smart quotes (single or double), so some glyphs should be easier to enter. All of these are still in assets/ in this repo.

textratypist - 0.7.5 "Turbo Mode"

Published by tommyettinger over 1 year ago

This release includes many small bug fixes, probably introduces some small bugs, and most notably adds special "alternate modes" that can be applied to text in TextraLabel and TypingLabel. These range from the commonly-requested outline modes (black or white), to drop shadow, to small caps, to word-processor-style red/yellow/blue wiggly underlines. The syntax to enable them is a little odd; see the README.md for the overview, but in general you use [%?shadow] if you want to enable just drop shadow, or [%^shadow] (with a caret instead of a question mark) to enable both small caps and drop shadow. Small caps can be applied at the same time as any one other mode, except "jostle", which isn't compatible with any other modes. Other than that, only one mode can be applied at a time, and it replaces the current scale (which is why the syntax starts with %). You can use more ways of writing a mode in a TypingLabel, like {STYLE=SHADOW}. The different modes are mostly shown in the animated preview in the README.md .

Many of the known fonts have been adjusted, in both KnownFonts.java and the .fnt files themselves, so you'll absolutely want to download the latest versions of any fonts you use. They are all in the knownFonts directory in this repo; you only need the ones you use, but some methods do use many different fonts for the sake of convenience.

The dependencies here are a little different; now we use RegExodus 0.1.14 (which is a minor stability update), and the GWT inherits have changed as well (see README.md for more info if you target HTML).

textratypist - 0.7.4 "Just Click And Drag"

Published by tommyettinger almost 2 years ago

This release mostly exists to add the selectable option to TypingLabel, though there are also some fixes for color handling. You can do what you like with selected text; when a selection is made available, the "*SELECTED" event is triggered, and you can call getSelectedText() or copySelectedText() on the TypingLabel to get or copy that selected range. You could also use selection for some other purpose, such as in puzzle gameplay.

textratypist - 0.7.3 "Glyph Glitz"

Published by tommyettinger about 2 years ago

This release is mostly a checkpoint before some major, possibly-longer-term, work starts on an equivalent to TextField. Included here is a new Font.markupGlyph() method that just takes normal markup and returns the first char; this can be useful to enter emoji and get back a single glyph. HighlightEffect now can highlight the whole affected region of text when it is moused over. StylistEffect is new, and can enable bold/oblique/underline/strikethrough/etc. when a glyph or region is moused over (useful for links with conditional underline or other style markup). There's also some possibly-important fixes to Java 8 compatibility, which might have blocked 0.7.2 from working on RoboVM or maybe even GWT, and should be compatible now. That's all in this release; I wanted to get that last bug-fix out and make the few features I had added usable.

The known font files haven't changed since 0.7.2 .

textratypist - 0.7.2 "The Stars Aligned"

Published by tommyettinger about 2 years ago

This release consists mostly of polishing the rough positioning code, but also adds 3 hand-written-looking fonts to KnownFonts (2 versions of a script font Tangerine, and a hasty-looking font Caveat). Positions are much more consistent now between TextraLabel and TypingLabel (they should be identical now, if stacked), and fonts tend to stay within their reported bounding boxes much more reliably.

There is a possible issue with the approach used now to ensure fonts stay the right size: creating a Font with a BitmapFont (or a style from a Skin) is more likely to need some adjustment on y (the second of four floats in Font's constructor). This adjustment could range from -20 to 20, or even to larger values for fonts with a large line height. I haven't found any 100% foolproof way to handle line height, baseline, strikethrough position, underline position, cap height, cap height with accents, and so on... So the best way is to allow users to control the font metrics themselves, I think. You can also just use KnownFonts or see how it configures the yAdjust. Right now, all of the fonts in KnownFonts act suitably regarding their position, which hasn't been the case very frequently before.

You should consider updating the .fnt , .png , and license files if you use KnownFonts, since some files have changed slightly, and a few more fonts have been added.

textratypist - 0.7.1 "The Deadly Dropbear"

Published by tommyettinger about 2 years ago

This release is small, but drops the used language level to 7 in an attempt to maximize Android/iOS compatibility (we didn't actually need any Java 8 features), and fixes a line wrapping bug with two- or three-word lines. Other than some improvements to the README.md that document frequently-encountered issues, that's most of this release's content. The line wrapping bug seemed serious enough to warrant a release sooner rather than later, since it was visually jarring and broke the bounds of cells.

textratypist - 0.7.0 "Just Press Play"

Published by tommyettinger about 2 years ago

This release has a broad mix of new features, and even if you don't use them, it also improves the appearance of several fonts from KnownFonts.

Probably the biggest new feature is that TypingLabel now can respond to mouse/touchscreen input, both for mouse hover/drag and click/tap events. Hover is used in HighlightEffect and AttentionEffect, and clicking is used by LinkEffect and TriggerEffect. These last two have been requested for a while now; {LINK=https://github.com/tommyettinger/textratypist}the TextraTypist repo{ENDLINK} will make the text the TextraTypist repo open a browser and go to the TextraTypist repo if clicked. Similarly, {TRIGGER=someEvent} will cause an event to trigger by name, just like the {EVENT=someEvent} tag can, but TRIGGER does so when clicked.

To make using TypingLabel everywhere an option for games that want things like clickable labels, there's a skipToTheEnd() method on almost every widget we have (maybe all of them?). This does nothing if the widget only contains TextraLabels, but will make TypingLabel skip to the end as if it completed its typing animation (it will still show effects and respond to mouse events).

There's a new font, QuanPixel, which should fill two common requests: a small variable-width pixel font, and another font that covers a lot of CJK glyphs. QuanPixel covers about half as many glyphs as Hanazono, but it is a pixel-style font and so would make sense in different games.

You can describe colors a little more freely now; "light gold" would have worked in the last version, but "bright gold" wouldn't because "bright" wasn't recognized. Now it is, as are 3 more new adjectives (pale, deep, and weak). Invalid color names and adjectives are also ignored completely now, instead of making the color more transparent.

Whew! Have fun out there!

textratypist - 0.6.3 "Descriptions and Descenders"

Published by tommyettinger about 2 years ago

So, where were we... There was the 0.6.2 release, then raeleus released a video about TextraTypist, so a lot more users came in, and that means... a welcome is in order! This also meant a number of issues and/or requests! Some users wanted to have more flexibility in how they can store font assets, so now you can give a prefix directly to KnownFonts and it will look in that directory and/or with that filename prefix. There's some changes to positioning to better locate text on a baseline, or close to it; this works especially well when creating a Font from a BitmapFont like the UI code often does. A big new thing is that you can now describe colors by mixing and adding adjectives to names from Colors in libGDX or SimplePalette from colorful-gdx; the README.md documents this and provides links to palette previews. Other than some of the inevitable changes to underline and strikethrough position (which seem to be needed whenever there's any change to Font...), that's about it!

textratypist - 0.6.2 "Paging Dr. Frankenstein"

Published by tommyettinger over 2 years ago

This release mostly patches up existing features from the 0.6.x line that had various bugs. For instance, the first TextureRegion in any atlas couldn't be looked up by name before, but now it can. There was a moderately-complex bug where multiple newlines didn't always appear; now they are sized correctly and so do appear as they should. There were various visual issues, particularly with vertical position, with emoji in Fonts created from BitmapFonts (such as those in many skins); these all seem to be fixed. There was an incredibly complicated bug where building a JAR and running it on Java 8 wouldn't load emoji that used the [+🎷] syntax, but would load the [+saxophone] syntax. This bug also happened up to and including Java 17, but didn't happen on the recent Java 18. Don't worry, I fixed that one. My head still hurts thinking about it.

Feature-wise, there's some better handling of case-insensitive Strings in some places thanks to a somewhat-monstrous data structure that mixes parts of jdkgdxds' CaseInsensitiveObjectMap and libGDX's ObjectIntMap. You can create a FontFamily from a Skin with multiple BitmapFonts defined.

Hanazono, the large CJK-character-heavy font, is now removed from KnownFonts.getStandardFamily() by default, because loading it added measurably to startup time.

You shouldn't need to update the font assets in this update if you have the ones from 0.6.1 .

I hope this works well enough for your text-display needs!

textratypist - 0.6.1 "Emojional Support Animal"

Published by tommyettinger over 2 years ago

This release has several important fixes for issues in 0.6.0 (released a whole four days ago). Emoji now wrap correctly, as do VAR replacements in TypingLabels. Event scheduling got some fixes, since the first glyph wasn't sending an event (again) and effects in some TypingLabels weren't lining up with where they were supposed to end. There's a lot of tweaks to underline and strikethrough to try to make them work for more fonts, though currently they might not act correctly if line height changes. There's a fix for TextraTooltip, also.

As for new features, there's a new font, Hanazono, which has incredibly good CJK glyph coverage, but doesn't resize very well. There are some fixes to AStarry-standard's files, and to most fonts' metrics in KnownFonts. For this reason, it is recommended to download any .fnt and .png files you use again. There are also variants on the TextraThing widgets, like TextraWindow, as TypingThing widgets, like TypingWindow; these use a TypingLabel instead of a TextraLabel where appropriate.

Package Rankings
Top 6.69% on Proxy.golang.org
Top 32.9% on Repo1.maven.org