Macro to Create "Unicode" Styles in WordPerfect

The following discussion arose when someone on Twitter suggested it wasn't possible to use Unicode characters in a WordPerfect document in view of the fact that Unicode isn't supported in WordPerfect. I posted a response on Twitter, but thought I should convert the text of the discussion to HTML and post it here for the benefit of the WP community. I will send him a tweet with a link to this article.

Assuming the existence of a Chinese alphabet, one might create a "Chinese" keyboard and map Unicode character styles, invoked by macros assigned as keyboard shortcuts to this keyboard as a workaround to creating documents containing Chinese words in WordPerfect based on their visual similarities to corresponding English alphabet letters in view of the fact that WordPerfect doesn't support Unicode:

Twitter: @Michael_JBarnes and @wpcguy
@Michael_JBarnes: @mywordperfect Any chance that WP will ever add full Unicode support? Had to switch to MS, but miss WP's functionality.
@wpcguy: @mywordperfect @Michael_JBarnes #WPX7
Corel is unlikely to reengineer the WordPerfect character sets and incur costs to support Unicode
@Michael_JBarnes: @wpcguy #WPX7
It's sad. Corel's setting themselves up to shrink user base. They'll lose law base with no interernational char. support.
@wpcguy: @Michael_JBarnes #WPX7
Corel's user base with respect to WordPerfect will not shrink beyond its current size -- Lawyers don't need Unicode
@wpcguy: @Michael_JBarnes #WPX7
If a lawyer should need one or more Unicode characters in their document, this is doable in WordPerfect (8 steps):
@wpcguy: @Michael_JBarnes #WPX7
① Create a one-character jpg file (e.g., Chinese "A")
② Open the jpg file in WordPerfect
@wpcguy: @Michael_JBarnes #WPX7
③ Double-click the graphic box
④ Position…: Attach box to Character (Top; box changes text line height is checked)
@wpcguy: @Michael_JBarnes #WPX7
⑤ Size…: Width: .300" (Height: Maintain proportions)
⑥ Image Tools…: Edit Attributes…, Scale image: Both X & Y: 3.0
@wpcguy: @Michael_JBarnes #WPX7
⑦ Copy graphic box to new Open Style (e.g., ChineseA)
⑧ Insert "ChineseA” Style (as many times as you need

Done!
@Michael_JBarnes: @wpcguy #WPX7
that is hardly simple for other languages. I know #s of people who switched to MS with the need for international characters
@wpcguy: @Michael_JBarnes #WPX7
When WPCorp sold its company to Novell, WordPerfect supported many international characters, but not Unicode
@wpcguy: @Michael_JBarnes #WPX7
When Novell sold its company to Corel, WordPerfect continued to support international characters, but not Unicode
@wpcguy: @Michael_JBarnes #WPX7
A macro can be created to automate the creation of the styles needed to write Unicode characters in WordPerfect
@wpcguy: @Michael_JBarnes #WPX7
Macros to each Unicode style can be assigned as keyboard shortcuts to the "a" key, "b" key, "c" key, etc.
@wpcguy: @Michael_JBarnes #WPX7
Each macro would resemble something like this:

vLtr:="a"
vMacPath:="c:\MyFiles\Macros\"

MacroPlay(vMacPath + vLtr)
@wpcguy: @Michael_JBarnes #WPX7
Link to the macro code, but you'll have to create the "newltr1.jpg" … "newltr26.jpg" files:

tl.gd/n_1sje2j2
@wpcguy: @Michael_JBarnes #WPX7
I'm sure some folks switched from WordPerfect to Word because they did not how how to write Unicode in WordPerfect
@wpcguy: @Michael_JBarnes #WPX7
I'm also sure some folks switched from WordPerfect to Word at the behest of one's IT Department at work or at school
@wpcguy: @Michael_JBarnes #WPX7
WordPerfect doesn't support Unicode, but one can workaround its limitations and write four-byte Chinese characters
@wpcguy: @Michael_JBarnes #WPX7
If one must use Unicode to write international characters, then use Word, but the rest can use WordPerfect or Word

As I mentioned above, while no genuine Chinese alphabet exists, if one doesn't know Chinese, but is given English characters to copy-type Chinese words, then a "Chinese" keyboard mapped to Chinese character styles assigned to macros launched using keyboard shortcuts is a workaround that will enable a WordPerfect user to produce documents containing Chinese words based on their visual similarities to the corresponding English alphabet using Unicode characters. Each of the following zip files (2) contain a single Chinese character:


"A" (Yuè) Moon
newltr1.zip


"B" (Guān) Official
newltr2.zip

Below is the macro code that can be used to created the styles. Let me emphasize here that this macro code below is a workaround.


[code]
Application (WordPerfect; "WordPerfect"; Default!)

vLtr:="newltr1.jpg"

vUPath:="c:\Chinese\"

sname:="ltra"
fname:=vUPath + vLtr
AddStyle (sname; fname)
StyleSystemOn (sname)
QUIT

PROCEDURE AddStyle (s; f)
StyleCreate (s; ParagraphStyle!; Library: CurrentDoc!)
StyleEditBegin (s; CurrentDoc!)
StyleCodes (WithoutOffCodes!)

BoxCreate ("I&mage")
BoxContentType (Image!)
BoxImageRetrieve (MakeInternal!; f)
BoxAttachTo (Character!)
BoxWidth (0.3")
BoxUpdateDisplay
BoxImageScaling (3.0; 3.0)
BoxWidth (Width: 0.3")
BoxImageScaling (3.0; 3.0)
BoxEnd (Save!)

StyleRename (s)
StyleType (OpenStyle!)
SubstructureExit
StyleEditEnd (Save!)
ENDPROC
[/code]


[code]
Application (WordPerfect; "WordPerfect"; Default!)

// To create 26 lower-case Unicode characters

vUPath:="c:\Chinese\"
vLtr:="newltr"

FORNEXT (i; 1; 26; 1)
sname:="ltr" + NTOC(i + 96)
fname:=vUPath + vLtr + i + ".jpg"
AddStyle (sname; fname)
StyleSystemOn (sname)
ENDFOR
QUIT

PROCEDURE AddStyle (s; f)
.
.
.
ENDPROC
[/code]


[code]
Application (WordPerfect; "WordPerfect"; Default!)

// To create 26 upper-case Unicode characters

vUPath:="c:\Chinese\"
vLtr:="newltrC"

FORNEXT (i; 1; 26; 1)
sname:="ltr" + NTOC(i + 64)
fname:=vUPath + vLtr + i + ".jpg"
AddStyle (sname; fname)
StyleSystemOn (sname)
ENDFOR
QUIT

PROCEDURE AddStyle (s; f)
.
.
.
ENDPROC
[/code]