Did you know ... Search Documentation:
Pack onepointfour_basics -- prolog/stringy_justify.pl
PublicShow source

Homepage for this code

https://github.com/dtonhofer/prolog_code/blob/main/unpacked/onepointfour_basics/doc/README_stringy_justify.md

 justify_left(FieldWidth, Text, Result, ResultType, SettingsDict)
Standard "left justify", everything is default.
 justify_left(FieldWidth, Text, Result, ResultType, SettingsDict)
Justify Text left inside a field of width FieldWidth, yielding the Result of the type given by ResultType (one of string, atom). ResultType can also be deduced if Result is instantiated on call, or else from the given Text.

SettingsDict can contain:

cut_left - a boolean, cut the result at left field limit (default true) cut_right - a boolean, cut the result at right field limit (default true) offset - an integer, used for "offset on the left" when justifying left

 justify_right(FieldWidth, Text, Result, ResultType)
Standard "right justify", everything is default.
 justify_right(FieldWidth, Text, Result, ResultType, SettingsDict)
Justify Text right inside a field of width FieldWidth, yielding the Result of the type given by ResultType (one of string, atom). ResultType can also be deduced if Result is instantiated on call, or else from the given Text.

SettingsDict can contain:

cut_left cut_right offset

 justify_center(FieldWidth, Text, Result, ResultType)
Standard "center justify", everything is default.
 justify_center(FieldWidth, Text, Result, ResultType, SettingsDict)
Justify Text centrally inside a field of width FieldWidth, yielding the Result of the type given by ResultType (one of string, atom). ResultType can also be deduced if Result is instantiated on call, or else from the given Text.

SettingsDict can contain:

cut_left cut_right offset_left offset_right prefer - leftly,rightly : where to prefer shifting the foreground left or right if full central alignment is impossible

Undocumented predicates

The following predicates are exported, but not or incorrectly documented.

 justify_left(Arg1, Arg2, Arg3, Arg4)
 justify_how(Arg1, Arg2, Arg3, Arg4, Arg5)
 justify_how(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6)