org.das2.util.Entities

Encoder and decoder for HTML entities, like ρ for ρ. See https://shapecatcher.com/ to identify shapes and also https://detexify.kirelabs.org/classify.html for identifying LaTeX characters (which are not supported here).

Entities( )


decode

decode( String entity ) → String

decode one entity, and "" empty string is returned when the string cannot be decoded.

Parameters

entity - like ρ

Returns:

unicode character like "ρ"

[search for examples] [view on GitHub] [view on old javadoc] [view source]


decodeEntities

decodeEntities( String str ) → String

utility method for decoding entities like ρ into UNICODE. Malformed entities (like B1; instead of α) are formatted as "???"

Parameters

str - string e.g. "ρ degrees"

Returns:

string with Unicode characters for entities.

[search for examples] [view on GitHub] [view on old javadoc] [view source]


encode

encode( String s ) → String

encode one or more entities.

Parameters

s - string with unicode like "ρ"

Returns:

like ρ

[search for examples] [view on GitHub] [view on old javadoc] [view source]


fontSupports

fontSupports( java.awt.Font f, String s ) → boolean

return true of the font supports each character of the string.

Parameters

f - a Font
s - a String

Returns:

a boolean

[search for examples] [view on GitHub] [view on old javadoc] [view source]


main

main( java.lang.String[] args ) → void

Parameters

args - a java.lang.String[]

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


pickEntityGUI

pickEntityGUI( ) → String

provide a picker GUI

Returns:

empty string or the selected character HTML.

[search for examples] [view on GitHub] [view on old javadoc] [view source]