add unicode control-picturizer and docs
parent
4cb04165db
commit
949b391f02
|
@ -0,0 +1 @@
|
|||
Pi
|
|
@ -0,0 +1,16 @@
|
|||
! Copyright (C) 2017 Pi.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: help.markup help.syntax help.topics strings ;
|
||||
IN: unicode.control-pictures
|
||||
|
||||
HELP: control-pictures
|
||||
{ $values
|
||||
{ "string" string }
|
||||
}
|
||||
{ $description "Transforms C0 control characters into their corresponding Control Picture block codepoints." } ;
|
||||
|
||||
ARTICLE: "unicode.control-pictures" "Control Pictures"
|
||||
"The " { $vocab-link "unicode.control-pictures" } " vocabulary provides a utility word " { $link control-pictures } " for transforming characters in the nonprintable ASCII C0 block to their representations in the Control Pictures block. It has no effect on any other characters."
|
||||
;
|
||||
|
||||
ABOUT: "unicode.control-pictures"
|
|
@ -0,0 +1,18 @@
|
|||
! Copyright (C) 2017 Pi.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: combinators kernel math sequences ;
|
||||
IN: unicode.control-pictures
|
||||
|
||||
<PRIVATE
|
||||
|
||||
: char>control-picture ( char -- char' )
|
||||
{
|
||||
{ [ dup 0x20 < ] [ 0x2400 bitor ] }
|
||||
{ [ dup 0x7f = ] [ drop 0x2421 ] }
|
||||
[ ]
|
||||
} cond ;
|
||||
|
||||
PRIVATE>
|
||||
|
||||
: control-pictures ( string -- string )
|
||||
[ char>control-picture ] map ;
|
Loading…
Reference in New Issue