Skip to main content

Formatters (Fx's)

Available since the first release, Formatters (or "Fx's" for short) are one essential part of Kase's vision. They allow the user to quickly visualize data in different ways without actually changing the data.

Fx types

Originally Kase supported three types of Formatters:

  • ICU Transform,
  • TransformerKit,
  • and Kase's own KaseFx.

Beginning in v4.5, Kase simplifies and extends the power of Formatters, and support for TransformerKit has been folded into the new KaseFx command StringTransformer.

ICU Transform

ICU Transform is a part of the Unicode libraries from the International Components for Unicode (ICU). Transforms are used to process Unicode text in many different ways, including case mapping, width conversion, normalization, transliteration, and hex & character name conversion.

In iOS's heritage (macOS, Cocoa, NeXT, etc.), ICU Transform has long been a supported feature. Kase brings this power close to the user. New since v4.0, you can use any valid ICU String Transforms. See the ICU user guide for full documentation.

Fx directive
[transform identifier]

Examples:

  • Lower; Latin-Katakana
  • [aeiou] Upper

Case mapping

Examples:

  • Lower would convert "Gundam -> "gundam"
  • Uppper would convert "Gundam -> "GUNDAM"

Width conversion

Examples:

  • FullWidth
  • Halfwidth

Normalization

Examples:

  • NFD
  • NFC

Transliteration

Script transliteration is not translation; it is the conversion of letters from one script to another without translating the underlying words.

Examples:

  • Latin-Hiragana transliterates “hiragana” to “ひらがな”.
  • Indic

Character Representation

Examples:

  • Name
  • Hex
  • Publishing
  • ASCII

KaseFx

In addition to ICU Transform, Kase also supports its own custom formatter: KaseFx.

As of v4.5, there are four supported commands:

  • StringTransformer (new since v4.5)
  • NameMapper (new since v4.0)
  • WordScrambler (new since v4.0)
  • UnitConverter

StringTransformer

StringTransformer transforms your text input according the the specified subcommands.

subcommand & aliases"This is the RX-78 Gundam"
Capitalized"This Is The RX-78 Gundam"
Uppercase"THIS IS THE RX-78 GUNDAM"
Lowercase"this is the rx-78 gundam"
CamelCase (1st word left as is)"ThisIsTheRX-78Gundam"
UpperCamelCase, PascalCase"ThisIsTheRx-78Gundam"
LowerCamelCase, DromedaryCase, LlamaCase"thisIsTheRx-78Gundam"
SnakeCase, SnailCase, PotholeCase"This_is_the_RX-78_Gundam"
KebabCase, DashCase, LispCase, SpinalCase"This-is-the-RX-78-Gundam"
TrainCase"This-Is-The-RX-78-Gundam"
Reversed, Reverse, Rev"madnuG 87-XR eht si sihT"
RemovePuntuations, RemPuns"This is the RX78 Gundam"
icu:[transform identifier]
directive
StringTransformer [subcommand]

E.g. StringTransformer lowercase

And you can use multiple subcommands to chain the effect!

Fx directive
StringTransformer [subcommand] [subcommand] [subcommand]...

E.g. StringTransformer remPuns pascalCase

Lastly, with the icu: subcommand, you can utilize ICU tranforms right within a StringTransformer!

E.g. StringTransformer remPuns pascalCase icu:Hiragana

NameMapper

NameMapper maps a Boolean or number into supplied name labels.

Fx directive
NameMapper [LabelTrue] [LabelFalse]

E.g. NameMapper Real Fake

Fx directive
NameMapper [Label1] [Label2] [Label3] ...

E.g. NameMapper Hope Faith Love

WordScrambler

WordScrambler reads in text and scrambles each word according to the directive.

Fx directive
WordScrambler [prefix-to-keep] [suffix-to-keep] [transposes-to-make]

E.g., WordScrambler 1 1 1 will, for every word, keep the first one letter, keep the last one letter, and perform one transpose to scramble the rest of the word.

UnitConverter

UnitConverter converts text input that includes a number and a unit to the specified unit.

Fx directive
UnitConverter [from] [to]

E.g. UnitConverter _ cm


Making Fx's Available

You can define a Fx manually from scratch, or you can import the built-in ones, and then edit them to your liking. Once defined, a Fx is available across all Boxes inside your Kase.

Each Fx has four fields of text info:

  • name
  • type
  • directive
  • reverse

Kase level

From the Side Menu, tap Formatters to open the Formatters window. Here you select which data type of Fx's to work with.

In the list of Fx's, tap a Fx to see an interactive Preview window.

The switch on the right hand side of each Fx is a global enabled/disabled toggle. Turn off any Fx to make it not available to Fields or Entries.

Field level

Finer control of availability can be adjusted at the Field level.

In a Deck Definitions window, tap any Field to go into the Field options window.

If the Field type supports Formatters (e.g. Text) you will see a "formatters" option.

In the list of Fx's, you can leave all enabled ones available to the Field, or select a few that make sense for the Field.

tip

Context menu has "Select All" and "Deselect All" commands.

You can even designate one as the Default Fx, so all data entries of this field will automatically have this Fx applied.

Apply Fx to Entry

In a data entry's context menu, if Fx's are available, you will see a "Select Formatter..." submenu with a selection of Fx's to apply.

When a Fx is applied, the context menu will change to include options to clear, and to Pin to the Entry.