Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: b43fcf96f8
Fetching contributors…

Cannot retrieve contributors at this time

file 454 lines (405 sloc) 18.202 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454
%
% Hangul infrastructure for Jieubsida
% Copyright (C) 2011 Matthew Skala
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, version 3.
%
% As a special exception, if you create a document which uses this font, and
% embed this font or unaltered portions of this font into the document, this
% font does not by itself cause the resulting document to be covered by the
% GNU General Public License. This exception does not however invalidate any
% other reasons why the document might be covered by the GNU General Public
% License. If you modify this font, you may extend this exception to your
% version of the font, but you are not obligated to do so. If you do not
% wish to do so, delete this exception statement from your version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/>.
%
% Matthew Skala
% http://ansuz.sooke.bc.ca/
% mskala@ansuz.sooke.bc.ca
%

inclusion_lock(hangul);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

input buildkanji.mp;

pair hgbox_ll,hgbox_ul,hgbox_lr,hgbox_ur;

hgbox_ll=(50,-50);
hgbox_ul=(50,850);
hgbox_lr=(950,-50);
hgbox_ur=(950,850);

pair hgbox_lb,hgbox_rb,hgbox_ub,hgbox_db;

hgbox_lb=0.5[hgbox_ll,hgbox_ul];
hgbox_rb=0.5[hgbox_lr,hgbox_ur];
hgbox_ub=0.5[hgbox_ul,hgbox_ur];
hgbox_db=0.5[hgbox_ll,hgbox_lr];

% return a translate-and-scale (no rotation or skew) transform that takes
% the (50,850)-(950,-50) square to the specified upper left and lower
% right coordinates
vardef hxf(expr ul,lr) =
  begingroup
    save rval;
    transform rval;
    hgbox_ul transformed rval=ul;
    hgbox_lr transformed rval=lr;
    hgbox_ll transformed rval=(xpart ul,ypart lr);
    rval
  endgroup
enddef;

vardef hxf_inout(expr iotype,ixf,oxf) =
  begingroup
    save rval,vv,hv;
    transform rval;
    pair vv,hv;
    vv=(hgbox_ul transformed oxf)-(hgbox_ll transformed oxf);
    hv=(hgbox_lr transformed oxf)-(hgbox_ll transformed oxf);
    (hgbox_ul transformed rval)-(hgbox_ll transformed rval)=
      whatever*vv;
    (hgbox_lr transformed rval)-(hgbox_ll transformed rval)=
      whatever*hv;
    hgbox_rb transformed rval=whatever*vv+(hgbox_rb transformed
      if (iotype mod 2)=1: oxf else: ixf fi);
    hgbox_ub transformed rval=whatever*hv+(hgbox_ub transformed
      if (iotype mod 4)>=2: oxf else: ixf fi);
    hgbox_lb transformed rval=whatever*vv+(hgbox_lb transformed
      if (iotype mod 8)>=4: oxf else: ixf fi);
    hgbox_db transformed rval=whatever*hv+(hgbox_db transformed
      if iotype>=8: oxf else: ixf fi);
    rval
  endgroup
enddef;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Much useful information about how Unicode encodes hangul syllables is
% at http://www.uni-graz.at/~katzer/korean_hangul_unicode.html , and
% I'm following that source's nomenclature of "lead, vowel, tail."

% jamo IDs used in the table:
% 100+ lead
% 300+ vowel
% 500+ tail
% add 100 for alternate form, which is usually the one used on the left in
% multi-consonant clusters (like "leftrad" or "lift_skirt" in kanji)

string hangul.jamo[]code;
boolean hangul.jamo[]invokes_alternate;

% fill in default values for jamo - saves typing
vardef hangul.fill_in_jamo(expr jid) =
  if unknown hangul.jamo[jid]code: hangul.jamo[jid]code="jamo.bigx"; fi;
  if unknown hangul.jamo[jid]w: hangul.jamo[jid]w=4; fi;
  if unknown hangul.jamo[jid]h: hangul.jamo[jid]h=4; fi;
  if unknown hangul.jamo[jid]lb: hangul.jamo[jid]lb=50; fi;
  if unknown hangul.jamo[jid]rb: hangul.jamo[jid]rb=950; fi;
  if unknown hangul.jamo[jid]ub: hangul.jamo[jid]ub=850; fi;
  if unknown hangul.jamo[jid]db: hangul.jamo[jid]db=-50; fi;
  if unknown hangul.jamo[jid]invokes_alternate:
    hangul.jamo[jid]invokes_alternate=true;
  fi;
enddef;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% JAMO COMBINING OPERATIONS

% calling convention: hangul macros generally take a final set of
% parentheses containing a vowel ID and two transforms, ixf and oxf.
% The ixf transform will transform the (50,-50) to (950,850) square into
% where the jamo (or combination thereof) should be placed. The oxf
% transform transforms that same square into a possibly-larger space
% representing limits created by adjacent jamo; this allows for parts
% of jamo that may extend into the adjacent jamo's space conditionally
% on the shape of the adjacent jamo.
%
% The "id" family of arguments are jamo IDs pointing into the hangul.jamo
% tables.

vardef hangul.combine.lr(expr lid,rid)(expr vow,ixf,oxf) =
  % put in default values if necessary
  hangul.fill_in_jamo(lid);
  hangul.fill_in_jamo(rid);

  % set up transform variables
  begingroup
    save lixf,loxf,rixf,roxf;
    transform lixf,loxf,rixf,roxf;

    % left inner transform
    hgbox_ul transformed lixf=hgbox_ul transformed ixf;
    hgbox_ll transformed lixf=hgbox_ll transformed ixf;
    if hangul.jamo[lid]w+hangul.jamo[rid]w=0:
      hgbox_lr transformed lixf=(0.5[hgbox_ll,hgbox_lr]) transformed ixf;
    else:
      hgbox_lr transformed lixf=
        ((hangul.jamo[lid]w/(hangul.jamo[lid]w+hangul.jamo[rid]w))
          [hgbox_ll,hgbox_lr]) transformed ixf;
    fi;
    
    % right inner transform
    hgbox_ur transformed rixf=hgbox_ur transformed ixf;
    hgbox_lr transformed rixf=hgbox_lr transformed ixf;
    hgbox_ll transformed rixf=hgbox_lr transformed lixf;
    
    % left outer transform
    (hgbox_ul transformed loxf)-(hgbox_ll transformed loxf)=
      whatever*((hgbox_ul transformed oxf)-(hgbox_ll transformed oxf));
    (hgbox_lr transformed loxf)-(hgbox_ll transformed loxf)=
      whatever*((hgbox_lr transformed oxf)-(hgbox_ll transformed oxf));
    (hgbox_lb transformed loxf)=
      (whatever[hgbox_ll,hgbox_ul]) transformed oxf;
    (hgbox_rb transformed loxf)=
      (hangul.jamo[rid]lb,400) transformed rixf
      +whatever*((hgbox_ul transformed oxf)-(hgbox_ll transformed oxf));
    (hgbox_ub transformed loxf)=
      (whatever[hgbox_ul,hgbox_ur]) transformed oxf;
    (hgbox_db transformed loxf)=
      (whatever[hgbox_ll,hgbox_lr]) transformed oxf;

    % right outer transform
    (hgbox_ul transformed roxf)-(hgbox_ll transformed roxf)=
      whatever*((hgbox_ul transformed oxf)-(hgbox_ll transformed oxf));
    (hgbox_lr transformed roxf)-(hgbox_ll transformed roxf)=
      whatever*((hgbox_lr transformed oxf)-(hgbox_ll transformed oxf));
    (hgbox_lb transformed roxf)=
      (hangul.jamo[lid]rb,400) transformed lixf
      +whatever*((hgbox_ul transformed oxf)-(hgbox_ll transformed oxf));
    (hgbox_rb transformed roxf)=
      (whatever[hgbox_lr,hgbox_ur]) transformed oxf;
    (hgbox_ub transformed roxf)=
      (whatever[hgbox_ul,hgbox_ur]) transformed oxf;
    (hgbox_db transformed roxf)=
      (whatever[hgbox_ll,hgbox_lr]) transformed oxf;

    % draw the contents
    hangul.scantokens hangul.jamo[lid]code (vow,lixf,loxf);
    hangul.scantokens hangul.jamo[rid]code (vow,rixf,roxf);
  endgroup;
enddef;

vardef hangul.combine.lcr(expr lid,cid,rid)(expr vow,ixf,oxf) =
  % put in default values if necessary
  hangul.fill_in_jamo(lid);
  hangul.fill_in_jamo(cid);
  hangul.fill_in_jamo(rid);

  % set up transform variables
  begingroup
    save lixf,loxf,cixf,coxf,rixf,roxf;
    transform lixf,loxf,cixf,coxf,rixf,roxf;

    % left inner transform
    hgbox_ul transformed lixf=hgbox_ul transformed ixf;
    hgbox_ll transformed lixf=hgbox_ll transformed ixf;
    if hangul.jamo[lid]w+hangul.jamo[cid]w+hangul.jamo[rid]w=0:
      hgbox_lr transformed lixf=(0.333[hgbox_ll,hgbox_lr]) transformed ixf;
    else:
      hgbox_lr transformed lixf=
        ((hangul.jamo[lid]w/
         (hangul.jamo[lid]w+hangul.jamo[cid]w+hangul.jamo[rid]w))
          [hgbox_ll,hgbox_lr]) transformed ixf;
    fi;

    % centre inner transform
    hgbox_ul transformed cixf=hgbox_ur transformed lixf;
    hgbox_ll transformed cixf=hgbox_lr transformed lixf;
    if hangul.jamo[lid]w+hangul.jamo[cid]w+hangul.jamo[rid]w=0:
      hgbox_lr transformed cixf=(0.667[hgbox_ll,hgbox_lr]) transformed ixf;
    else:
      hgbox_lr transformed cixf=
        (((hangul.jamo[lid]w+hangul.jamo[cid]w)/
         (hangul.jamo[lid]w+hangul.jamo[cid]w+hangul.jamo[rid]w))
          [hgbox_ll,hgbox_lr]) transformed ixf;
    fi;
    
    % right inner transform
    hgbox_ur transformed rixf=hgbox_ur transformed ixf;
    hgbox_lr transformed rixf=hgbox_lr transformed ixf;
    hgbox_ll transformed rixf=hgbox_lr transformed cixf;
    
    % left outer transform
    (hgbox_ul transformed loxf)-(hgbox_ll transformed loxf)=
      whatever*((hgbox_ul transformed oxf)-(hgbox_ll transformed oxf));
    (hgbox_lr transformed loxf)-(hgbox_ll transformed loxf)=
      whatever*((hgbox_lr transformed oxf)-(hgbox_ll transformed oxf));
    (hgbox_lb transformed loxf)=
      (whatever[hgbox_ll,hgbox_ul]) transformed oxf;
    (hgbox_rb transformed loxf)=
      (hangul.jamo[cid]lb,400) transformed cixf
      +whatever*((hgbox_ul transformed oxf)-(hgbox_ll transformed oxf));
    (hgbox_ub transformed loxf)=
      (whatever[hgbox_ul,hgbox_ur]) transformed oxf;
    (hgbox_db transformed loxf)=
      (whatever[hgbox_ll,hgbox_lr]) transformed oxf;

    % centre outer transform
    (hgbox_ul transformed coxf)-(hgbox_ll transformed coxf)=
      whatever*((hgbox_ul transformed oxf)-(hgbox_ll transformed oxf));
    (hgbox_lr transformed coxf)-(hgbox_ll transformed coxf)=
      whatever*((hgbox_lr transformed oxf)-(hgbox_ll transformed oxf));
    (hgbox_lb transformed coxf)=
      (hangul.jamo[lid]rb,400) transformed lixf
      +whatever*((hgbox_ul transformed oxf)-(hgbox_ll transformed oxf));
    (hgbox_rb transformed coxf)=
      (hangul.jamo[rid]lb,400) transformed rixf
      +whatever*((hgbox_ul transformed oxf)-(hgbox_ll transformed oxf));
    (hgbox_ub transformed coxf)=
      (whatever[hgbox_ul,hgbox_ur]) transformed oxf;
    (hgbox_db transformed coxf)=
      (whatever[hgbox_ll,hgbox_lr]) transformed oxf;

    % right outer transform
    (hgbox_ul transformed roxf)-(hgbox_ll transformed roxf)=
      whatever*((hgbox_ul transformed oxf)-(hgbox_ll transformed oxf));
    (hgbox_lr transformed roxf)-(hgbox_ll transformed roxf)=
      whatever*((hgbox_lr transformed oxf)-(hgbox_ll transformed oxf));
    (hgbox_lb transformed roxf)=
      (hangul.jamo[cid]rb,400) transformed cixf
      +whatever*((hgbox_ul transformed oxf)-(hgbox_ll transformed oxf));
    (hgbox_rb transformed roxf)=
      (whatever[hgbox_lr,hgbox_ur]) transformed oxf;
    (hgbox_ub transformed roxf)=
      (whatever[hgbox_ul,hgbox_ur]) transformed oxf;
    (hgbox_db transformed roxf)=
      (whatever[hgbox_ll,hgbox_lr]) transformed oxf;

    % draw the contents
    hangul.scantokens hangul.jamo[lid]code (vow,lixf,loxf);
    hangul.scantokens hangul.jamo[cid]code (vow,cixf,coxf);
    hangul.scantokens hangul.jamo[rid]code (vow,rixf,roxf);
  endgroup;
enddef;

vardef hangul.combine.syllable(expr lid,vid,tid)(expr vow,ixf,oxf) =
  % put in default values if necessary
  hangul.fill_in_jamo(lid);
  hangul.fill_in_jamo(vid);
  hangul.fill_in_jamo(tid);

  % set up transform variables
  begingroup
    save lixf,loxf,vixf,voxf,tixf,toxf;
    transform lixf,loxf,vixf,voxf,tixf,toxf;

    % lead inner transform
    hgbox_ul transformed lixf=hgbox_ul transformed ixf;
    if hangul.jamo[lid]w+hangul.jamo[vid]w=0:
      hgbox_ur transformed lixf=(0.5[hgbox_ul,hgbox_ur]) transformed ixf;
    else:
      hgbox_ur transformed lixf=
        ((hangul.jamo[lid]w/(hangul.jamo[lid]w+hangul.jamo[vid]w))
          [hgbox_ul,hgbox_ur]) transformed ixf;
    fi;
    if hangul.jamo[lid]h+hangul.jamo[vid]h+hangul.jamo[tid]h=0:
      hgbox_ll transformed lixf=(0.333[hgbox_ul,hgbox_ll]) transformed ixf;
    else:
      hgbox_ll transformed lixf=
        ((hangul.jamo[lid]h/
            (hangul.jamo[lid]h+hangul.jamo[vid]h+hangul.jamo[tid]h))
          [hgbox_ul,hgbox_ll]) transformed ixf;
    fi;

    % vowel inner transform
    hgbox_ul transformed vixf=hgbox_lr transformed lixf;
    if hangul.jamo[lid]h+hangul.jamo[vid]h+hangul.jamo[tid]h=0:
      hgbox_ur transformed vixf=(0.333[hgbox_ur,hgbox_lr]) transformed ixf;
      hgbox_lr transformed vixf=(0.333[hgbox_lr,hgbox_ur]) transformed ixf;
    else:
      hgbox_ur transformed vixf=
        ((hangul.jamo[lid]h/
            (hangul.jamo[lid]h+hangul.jamo[vid]h+hangul.jamo[tid]h))
          [hgbox_ur,hgbox_lr]) transformed ixf;
      hgbox_lr transformed vixf=
        ((hangul.jamo[tid]h/
            (hangul.jamo[lid]h+hangul.jamo[vid]h+hangul.jamo[tid]h))
          [hgbox_lr,hgbox_ur]) transformed ixf;
    fi;

    % tail inner transform
    hgbox_ll transformed tixf=hgbox_ll transformed ixf;
    hgbox_lr transformed tixf=hgbox_lr transformed ixf;
    hgbox_ur transformed tixf=hgbox_lr transformed vixf;
    
    % lead outer transform
    (hgbox_ul transformed loxf)-(hgbox_ll transformed loxf)=
      whatever*((hgbox_ul transformed oxf)-(hgbox_ll transformed oxf));
    (hgbox_lr transformed loxf)-(hgbox_ll transformed loxf)=
      whatever*((hgbox_lr transformed oxf)-(hgbox_ll transformed oxf));
    (hgbox_lb transformed loxf)=
      (whatever[hgbox_ll,hgbox_ul]) transformed oxf;
    (hgbox_rb transformed loxf)=
      (hangul.jamo[vid]lb,400) transformed vixf
      +whatever*((hgbox_ul transformed oxf)-(hgbox_ll transformed oxf));
    (hgbox_ub transformed loxf)=
      (whatever[hgbox_ul,hgbox_ur]) transformed oxf;
    (hgbox_db transformed loxf)=
      (500,hangul.jamo[vid]ub) transformed vixf
      +whatever*((hgbox_lr transformed oxf)-(hgbox_ll transformed oxf));

    % vowel outer transform
    (hgbox_ul transformed voxf)-(hgbox_ll transformed voxf)=
      whatever*((hgbox_ul transformed oxf)-(hgbox_ll transformed oxf));
    (hgbox_lr transformed voxf)-(hgbox_ll transformed voxf)=
      whatever*((hgbox_lr transformed oxf)-(hgbox_ll transformed oxf));
    (hgbox_lb transformed voxf)=
      (whatever[hgbox_ll,hgbox_ul]) transformed oxf;
    (hgbox_rb transformed voxf)=
      (whatever[hgbox_lr,hgbox_ur]) transformed oxf;
    (hgbox_ub transformed voxf)=
      (whatever[hgbox_ul,hgbox_ur]) transformed oxf;
    (hgbox_db transformed voxf)=
      (500,hangul.jamo[tid]ub) transformed tixf
      +whatever*((hgbox_lr transformed oxf)-(hgbox_ll transformed oxf));

    % tail outer transform
    (hgbox_ul transformed toxf)-(hgbox_ll transformed toxf)=
      whatever*((hgbox_ul transformed oxf)-(hgbox_ll transformed oxf));
    (hgbox_lr transformed toxf)-(hgbox_ll transformed toxf)=
      whatever*((hgbox_lr transformed oxf)-(hgbox_ll transformed oxf));
    (hgbox_lb transformed toxf)=
      (whatever[hgbox_ll,hgbox_ul]) transformed oxf;
    (hgbox_rb transformed toxf)=
      (whatever[hgbox_lr,hgbox_ur]) transformed oxf;
    (hgbox_ub transformed toxf)=
      (500,hangul.jamo[vid]db) transformed vixf
      +whatever*((hgbox_lr transformed oxf)-(hgbox_ll transformed oxf));
    (hgbox_db transformed toxf)=
      (whatever[hgbox_ll,hgbox_lr]) transformed oxf;
    
    % draw the contents
    build_kanji.level(hangul.scantokens hangul.jamo[vid]code (vid,vixf,voxf));
    hangul.scantokens hangul.jamo[lid]code (vid,lixf,loxf);
    hangul.scantokens hangul.jamo[tid]code
      (vid,hxf((100+20*mincho,850+30*mincho),(900-20*mincho,-50))
         transformed tixf,toxf);
  endgroup;
enddef;

vardef hangul.combine.tb(expr tid,bid)(expr vow,ixf,oxf) =
  % put in default values if necessary
  hangul.fill_in_jamo(tid);
  hangul.fill_in_jamo(bid);

  % set up transform variables
  begingroup
    save tixf,toxf,bixf,boxf;
    transform tixf,toxf,bixf,boxf;

    % top inner transform
    hgbox_ul transformed tixf=hgbox_ul transformed ixf;
    hgbox_ur transformed tixf=hgbox_ur transformed ixf;
    if hangul.jamo[tid]h+hangul.jamo[bid]h=0:
      hgbox_lr transformed tixf=(0.5[hgbox_ur,hgbox_lr]) transformed ixf;
    else:
      hgbox_lr transformed tixf=
        ((hangul.jamo[tid]h/(hangul.jamo[tid]h+hangul.jamo[bid]h))
          [hgbox_ur,hgbox_lr]) transformed ixf;
    fi;
    
    % bottom inner transform
    hgbox_lr transformed bixf=hgbox_lr transformed ixf;
    hgbox_ll transformed bixf=hgbox_ll transformed ixf;
    hgbox_ur transformed bixf=hgbox_lr transformed tixf;
    
    % left outer transform
    (hgbox_ul transformed toxf)-(hgbox_ll transformed toxf)=
      whatever*((hgbox_ul transformed oxf)-(hgbox_ll transformed oxf));
    (hgbox_lr transformed toxf)-(hgbox_ll transformed toxf)=
      whatever*((hgbox_lr transformed oxf)-(hgbox_ll transformed oxf));
    (hgbox_lb transformed toxf)=
      (whatever[hgbox_ll,hgbox_ul]) transformed oxf;
    (hgbox_rb transformed toxf)=
      (whatever[hgbox_lr,hgbox_ur]) transformed oxf;
    (hgbox_ub transformed toxf)=
      (whatever[hgbox_ul,hgbox_ur]) transformed oxf;
    (hgbox_db transformed toxf)=
      (500,hangul.jamo[bid]ub) transformed bixf
      +whatever*((hgbox_lr transformed oxf)-(hgbox_ll transformed oxf));

    % right outer transform
    (hgbox_ul transformed boxf)-(hgbox_ll transformed boxf)=
      whatever*((hgbox_ul transformed oxf)-(hgbox_ll transformed oxf));
    (hgbox_lr transformed boxf)-(hgbox_ll transformed boxf)=
      whatever*((hgbox_lr transformed oxf)-(hgbox_ll transformed oxf));
    (hgbox_lb transformed boxf)=
      (whatever[hgbox_ll,hgbox_ul]) transformed oxf;
    (hgbox_rb transformed boxf)=
      (whatever[hgbox_lr,hgbox_ur]) transformed oxf;
    (hgbox_ub transformed boxf)=
      (500,hangul.jamo[tid]db) transformed tixf
      +whatever*((hgbox_lr transformed oxf)-(hgbox_ll transformed oxf));
    (hgbox_db transformed boxf)=
      (whatever[hgbox_ll,hgbox_lr]) transformed oxf;

    % draw the contents
    hangul.scantokens hangul.jamo[tid]code (vow,tixf,toxf);
    hangul.scantokens hangul.jamo[bid]code (vow,bixf,boxf);
  endgroup;
enddef;
Something went wrong with that request. Please try again.