1 /* ctx git commit: 7c3507b7 */
    2 /* 
    3  * ctx.h is free software; you can redistribute it and/or
    4  * modify it under the terms of the GNU Lesser General Public
    5  * License as published by the Free Software Foundation; either
    6  * version 3 of the License, or (at your option) any later version.
    7  *
    8  * ctx.h is distributed in the hope that it will be useful,
    9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   11  * Lesser General Public License for more details.
   12  *
   13  * You should have received a copy of the GNU Lesser General Public
   14  * License along with ctx; if not, see <https://www.gnu.org/licenses/>.
   15  *
   16  * 2012, 2015, 2019, 2020, 2021, 2022 Øyvind Kolås <pippin@gimp.org>
   17  *
   18  * ctx is a 2D vector graphics processing processing framework.
   19  *
   20  * To use ctx in a project, do the following:
   21  *
   22  * #define CTX_IMPLEMENTATION
   23  * #include "ctx.h"
   24  *
   25  * Ctx contains a minimal default fallback font with only ascii, so
   26  * you probably want to also include a font, and perhaps enable
   27  * the cairo or SDL2 optional backends, a more complete example
   28  * could be:
   29  *
   30  * #include <cairo.h>
   31  * #include <SDL.h>
   32  * #include "ctx-font-regular.h"
   33  * #define CTX_IMPLEMENTATION
   34  * #include "ctx.h"
   35  *
   36  * The behavior of ctx can be tweaked, and features can be configured, 
   37  enabled
   38  * or disabled with other #defines, see further down in the start of this 
   39  file
   40  * for details.
   41  */
   42 
   43 #ifndef CTX_H
   44 #define CTX_H
   45 
   46 #ifdef __cplusplus
   47 extern "C" {
   48 #endif
   49 
   50 #include <stdint.h>
   51 #include <string.h>
   52 #include <stdio.h>
   53 
   54 typedef struct _Ctx            Ctx;
   55 
   56 /**
   57  * ctx_new:
   58  * @width: with in device units
   59  * @height: height in device units
   60  * @backend: backend to use
   61  *
   62  *   valid values are:
   63  *     NULL/"auto", "drawlist", "sdl", "term", "ctx" the strings are
   64  *     the same as are valid for the CTX_BACKEND environment variable.
   65  *
   66  * Create a new drawing context, this context has no pixels but
   67  * accumulates commands and can be played back on other ctx
   68  * render contexts, this is a ctx context using the drawlist backend.
   69  */
   70 Ctx *ctx_new (int width, int height, const char *backend);
   71 
   72 
   73 /**
   74  * ctx_new_drawlist:
   75  *
   76  * Create a new drawing context that can record drawing commands,
   77  * this is also the basis for creating more complex contexts with
   78  * the backend swapped out.
   79  */
   80 Ctx * ctx_new_drawlist (int width, int height);
   81 
   82 typedef struct _CtxEntry CtxEntry;
   83 
   84 
   85 /**
   86  * ctx_get_drawlist:
   87  * @ctx: a ctx context.
   88  * @count: return location for length of drawlist
   89  *
   90  * Returns a read only pointer to the first entry of the contexts drawlist.
   91  */
   92 const CtxEntry *ctx_get_drawlist (Ctx *ctx, int *count);
   93 
   94 /**
   95  * ctx_new_for_drawlist:
   96  *
   97  * Create a new drawing context for a pre-existing raw drawlist.
   98  */
   99 Ctx *ctx_new_for_drawlist   (int    width,
  100                              int    height,
  101                              void  *data,
  102                              size_t length);
  103 
  104 /**
  105  * ctx_set_drawlist:
  106  *
  107  * Replaces the drawlist of a ctx context with a new one.  the length of 
  108  the
  109  * data is expected to be length * 9;
  110  */
  111 int  ctx_set_drawlist       (Ctx *ctx, void *data, int length);
  112 
  113 /**
  114  * ctx_append_drawlist:
  115  *
  116  * Appends the commands in a binary drawlist, the length of the data is 
  117  expected to
  118  * be length * 9;
  119  */
  120 int  ctx_append_drawlist    (Ctx *ctx, void *data, int length);
  121 
  122 /**
  123  * ctx_drawlist_clear:
  124  *
  125  * Clears the drawlist associated with the context.
  126  */
  127 void  ctx_drawlist_clear (Ctx *ctx);
  128 
  129 
  130 const char *ctx_get_font_name (Ctx *ctx, int no);
  131 
  132 /* by default both are 0.0 which makes wrapping disabled
  133  */
  134 void ctx_wrap_left (Ctx *ctx, float x);
  135 void ctx_wrap_right (Ctx *ctx, float x);
  136 void ctx_line_height (Ctx *ctx, float x);
  137 
  138 
  139 /**
  140  * ctx_destroy:
  141  * @ctx: a ctx context
  142  */
  143 void ctx_destroy (Ctx *ctx);
  144 
  145 /**
  146  * ctx_start_frame:
  147  *
  148  * Prepare for rendering a new frame, clears internal drawlist and 
  149  initializes
  150  * the state.
  151  *
  152  */
  153 void ctx_start_frame    (Ctx *ctx);
  154 
  155 /**
  156  * ctx_end_frame:
  157  *
  158  * We're done rendering a frame, this does nothing on a context created for 
  159  a framebuffer, where drawing commands are immediate.
  160  */
  161 void ctx_end_frame      (Ctx *ctx);
  162 
  163 
  164 /**
  165  * ctx_begin_path:
  166  *
  167  * Clears the current path if any.
  168  */
  169 void ctx_begin_path     (Ctx *ctx);
  170 
  171 /**
  172  * ctx_save:
  173  *
  174  * Stores the transform, clipping state, fill and stroke sources, font size,
  175  * stroking and dashing options.
  176  */
  177 void ctx_save           (Ctx *ctx);
  178 
  179 /**
  180  * ctx_restore:
  181  *
  182  * Restores the state previously saved with ctx_save, calls to
  183  * ctx_save/ctx_restore should be balanced.
  184  */
  185 void ctx_restore        (Ctx *ctx);
  186 
  187 /**
  188  * ctx_start_group:
  189  *
  190  * Start a compositing group.
  191  *
  192  */
  193 void ctx_start_group    (Ctx *ctx);
  194 
  195 /**
  196  * ctx_end_group:
  197  *
  198  * End a compositing group, the global alpha, compositing mode and blend 
  199  mode
  200  * set before this call is used to apply the group.
  201  */
  202 void ctx_end_group      (Ctx *ctx);
  203 
  204 /**
  205  * ctx_clip:
  206  *
  207  * Use the current path as a clipping mask, subsequent draw calls are 
  208  limited
  209  * by the path. The only way to increase the visible area is to first call
  210  * ctx_save and then later ctx_restore to undo the clip.
  211  */
  212 void ctx_clip           (Ctx *ctx);
  213 
  214 
  215 /**
  216  * ctx_image_smoothing:
  217  *
  218  * Set or unset bilinear / box filtering for textures, turning it off uses 
  219  the
  220  * faster nearest neighbor for all cases.
  221  */
  222 void ctx_image_smoothing  (Ctx *ctx, int enabled);
  223 
  224 #define CTX_LINE_WIDTH_HAIRLINE -1000.0
  225 #define CTX_LINE_WIDTH_ALIASED  -1.0
  226 #define CTX_LINE_WIDTH_FAST     -1.0  /* aliased 1px wide line */
  227 
  228 
  229 
  230 /**
  231  * ctx_line_to:
  232  */
  233 void  ctx_line_to         (Ctx *ctx, float x, float y);
  234 /**
  235  * ctx_move_to:
  236  */
  237 void  ctx_move_to         (Ctx *ctx, float x, float y);
  238 /**
  239  * ctx_curve_to:
  240  */
  241 void  ctx_curve_to        (Ctx *ctx, float cx0, float cy0,
  242                            float cx1, float cy1,
  243                            float x, float y);
  244 /**
  245  * ctx_quad_to:
  246  */
  247 void  ctx_quad_to         (Ctx *ctx, float cx, float cy,
  248                            float x, float y);
  249 /**
  250  * ctx_arc:
  251  */
  252 void  ctx_arc             (Ctx  *ctx,
  253                            float x, float y,
  254                            float radius,
  255                            float angle1, float angle2,
  256                            int   direction);
  257 /**
  258  * ctx_arc_to:
  259  */
  260 void  ctx_arc_to          (Ctx *ctx, float x1, float y1,
  261                            float x2, float y2, float radius);
  262 /**
  263  * ctx_rel_arc_to:
  264  */
  265 void  ctx_rel_arc_to      (Ctx *ctx, float x1, float y1,
  266                            float x2, float y2, float radius);
  267 
  268 enum {
  269   CTX_TVG_FLAG_NONE       = 0,
  270   CTX_TVG_FLAG_LOAD_PAL   = 1<<0,
  271   CTX_TVG_FLAG_BBOX_CHECK = 1<<1,
  272   CTX_TVG_FLAG_DEFAULTS   = CTX_TVG_FLAG_LOAD_PAL
  273 };
  274 
  275 
  276 int ctx_tinyvg_get_size (uint8_t *data, int length, int *width, int *height)
  277                          ;
  278 int ctx_tinyvg_draw (Ctx *ctx, uint8_t *data, int length, int flags);
  279 
  280 int ctx_tinyvg_fd_get_size (int fd, int *width, int *height);
  281 int ctx_tinyvg_fd_draw (Ctx *ctx, int fd, int flags);
  282 
  283 /**
  284  * ctx_rectangle:
  285  */
  286 void  ctx_rectangle       (Ctx *ctx,
  287                            float x0, float y0,
  288                            float w, float h);
  289 /**
  290  * ctx_round_rectangle:
  291  */
  292 void  ctx_round_rectangle (Ctx *ctx,
  293                            float x0, float y0,
  294                            float w, float h,
  295                            float radius);
  296 /**
  297  * ctx_rel_line_to:
  298  */
  299 void  ctx_rel_line_to     (Ctx *ctx,
  300                            float x, float y);
  301 /**
  302  * ctx_rel_move_to:
  303  */
  304 void  ctx_rel_move_to     (Ctx *ctx,
  305                            float x, float y);
  306 /**
  307  * ctx_rel_curve_to:
  308  */
  309 void  ctx_rel_curve_to    (Ctx *ctx,
  310                            float x0, float y0,
  311                            float x1, float y1,
  312                            float x2, float y2);
  313 /**
  314  * ctx_rel_quad_to:
  315  */
  316 void  ctx_rel_quad_to     (Ctx *ctx,
  317                            float cx, float cy,
  318                            float x, float y);
  319 /**
  320  * ctx_close_path:
  321  */
  322 void  ctx_close_path      (Ctx *ctx);
  323 
  324 
  325 /**
  326  * ctx_fill:
  327  */
  328 void ctx_fill             (Ctx *ctx);
  329 
  330 /**
  331  * ctx_stroke:
  332  */
  333 void ctx_stroke           (Ctx *ctx);
  334 
  335 /**
  336  * ctx_paint:
  337  */
  338 void ctx_paint            (Ctx *ctx);
  339 
  340 /**
  341  * ctx_preserve:
  342  */
  343 void ctx_preserve         (Ctx *ctx);
  344 
  345 /**
  346  * ctx_identity:
  347  *
  348  * Restore context to identity transform, NOTE: a bug makes this call 
  349  currently
  350  * breaks mult-threaded rendering when used; since the rendering threads 
  351  are
  352  * expecting an initial transform on top of the base identity.
  353  */
  354 void ctx_identity       (Ctx *ctx);
  355 
  356 
  357 /**
  358  * ctx_scale:
  359  *
  360  * Scales the user to device transform.
  361  */
  362 void  ctx_scale           (Ctx *ctx, float x, float y);
  363 
  364 /**
  365  * ctx_translate:
  366  *
  367  * Adds translation to the user to device transform.
  368  */
  369 void  ctx_translate       (Ctx *ctx, float x, float y);
  370 
  371 /**
  372  * ctx_rotate:
  373  *
  374  * Add rotatation to the user to device space transform.
  375  */
  376 void ctx_rotate         (Ctx *ctx, float x);
  377 
  378 /**
  379  * ctx_apply_transform:
  380  *
  381  * Adds a 3x3 matrix on top of the existing user to device space transform.
  382  */
  383 void ctx_apply_transform (Ctx *ctx,
  384                      float a, float b, float c,
  385                      float d, float e, float f,
  386                      float g, float h, float i);
  387 
  388 /**
  389  * ctx_set_transform:
  390  *
  391  * Redundant with identity+apply?
  392  */
  393 void ctx_set_transform    (Ctx *ctx, float a, float b, float c,
  394                                      float d, float e, float f,
  395                                      float g, float h, float i);
  396 
  397 /**
  398  * ctx_miter_limit:
  399  *
  400  * Specify the miter limit used when stroking.
  401  */
  402 void ctx_miter_limit      (Ctx *ctx, float limit);
  403 
  404 /**
  405  * ctx_line_width:
  406  *
  407  * Set the line width used when stroking.
  408  */
  409 void ctx_line_width       (Ctx *ctx, float x);
  410 
  411 /**
  412  * ctx_line_dash_offset:
  413  *
  414  * Specify phase offset for line dash pattern.
  415  */
  416 void ctx_line_dash_offset (Ctx *ctx, float line_dash);
  417 
  418 /**
  419  * ctx_line_dash:
  420  *
  421  * Specify the line dash pattern.
  422  */
  423 void  ctx_line_dash       (Ctx *ctx, float *dashes, int count);
  424 
  425 /**
  426  * ctx_font_size:
  427  */
  428 void  ctx_font_size       (Ctx *ctx, float x);
  429 
  430 /**
  431  * ctx_font:
  432  */
  433 void  ctx_font            (Ctx *ctx, const char *font);
  434 
  435 /**
  436  * ctx_font_family:
  437  */
  438 void  ctx_font_family     (Ctx *ctx, const char *font_family);
  439 
  440 /**
  441  * ctx_parse:
  442  *
  443  * Parses a string containg text ctx protocol data.
  444  */
  445 void ctx_parse            (Ctx *ctx, const char *string);
  446 
  447 /**
  448  * low level glyph drawing calls, unless you are integrating harfbuzz
  449  * you probably want to use ctx_text instead.
  450  */
  451 typedef struct _CtxGlyph CtxGlyph;
  452 
  453 /**
  454  */
  455 CtxGlyph *ctx_glyph_allocate     (int n_glyphs);
  456 /**
  457  */
  458 void      ctx_glyph_free         (CtxGlyph   *glyphs);
  459 /**
  460  */
  461 int       ctx_glyph              (Ctx        *ctx, uint32_t unichar, int 
  462                                   stroke);
  463 /**
  464  */
  465 void      ctx_glyphs             (Ctx        *ctx,
  466                                   CtxGlyph   *glyphs,
  467                                   int         n_glyphs);
  468 /**
  469  */
  470 void  ctx_glyphs_stroke          (Ctx        *ctx,
  471                                   CtxGlyph   *glyphs,
  472                                   int         n_glyphs);
  473 
  474 void ctx_shadow_rgba      (Ctx *ctx, float r, float g, float b, float a);
  475 void ctx_shadow_blur      (Ctx *ctx, float x);
  476 void ctx_shadow_offset_x  (Ctx *ctx, float x);
  477 void ctx_shadow_offset_y  (Ctx *ctx, float y);
  478 
  479 /**
  480  * ctx_view_box:
  481  *
  482  * Specify the view box for the current page.
  483  */
  484 void ctx_view_box         (Ctx *ctx,
  485                            float x0, float y0,
  486                            float w, float h);
  487 
  488 void ctx_new_page         (Ctx *ctx);
  489 
  490 /**
  491  * ctx_set_pixel_u8:
  492  *
  493  * Set a single pixel to the nearest possible the specified r,g,b,a value. 
  494  Fast
  495  * for individual few pixels, slow for doing textures.
  496  */
  497 void
  498 ctx_set_pixel_u8          (Ctx *ctx, uint16_t x, uint16_t y, uint8_t r, 
  499                            uint8_t g, uint8_t b, uint8_t a);
  500 
  501 /**
  502  * ctx_global_alpha:
  503  *
  504  * Set a global alpha value that the colors, textures and gradients are 
  505  modulated by.
  506  */
  507 void  ctx_global_alpha     (Ctx *ctx, float global_alpha);
  508 
  509 
  510 /**
  511  * ctx_stroke_source:
  512  *
  513  * The next source definition applies to stroking rather than filling, when 
  514  a stroke source is
  515  * not explicitly set the value of filling is inherited.
  516  */
  517 void ctx_stroke_source  (Ctx *ctx); // next source definition is for 
  518                          stroking
  519 
  520 void ctx_rgba_stroke   (Ctx *ctx, float r, float g, float b, float a);
  521 void ctx_rgb_stroke    (Ctx *ctx, float r, float g, float b);
  522 void ctx_rgba8_stroke  (Ctx *ctx, uint8_t r, uint8_t g, uint8_t b, uint8_t 
  523                         a);
  524 
  525 void ctx_gray_stroke   (Ctx *ctx, float gray);
  526 void ctx_drgba_stroke  (Ctx *ctx, float r, float g, float b, float a);
  527 void ctx_cmyka_stroke  (Ctx *ctx, float c, float m, float y, float k, float 
  528                         a);
  529 void ctx_cmyk_stroke   (Ctx *ctx, float c, float m, float y, float k);
  530 void ctx_dcmyka_stroke (Ctx *ctx, float c, float m, float y, float k, float 
  531                         a);
  532 void ctx_dcmyk_stroke  (Ctx *ctx, float c, float m, float y, float k);
  533 
  534 void ctx_rgba   (Ctx *ctx, float r, float g, float b, float a);
  535 void ctx_rgb    (Ctx *ctx, float r, float g, float b);
  536 void ctx_rgba8  (Ctx *ctx, uint8_t r, uint8_t g, uint8_t b, uint8_t a);
  537 
  538 void ctx_gray   (Ctx *ctx, float gray);
  539 void ctx_drgba  (Ctx *ctx, float r, float g, float b, float a);
  540 void ctx_cmyka  (Ctx *ctx, float c, float m, float y, float k, float a);
  541 void ctx_cmyk   (Ctx *ctx, float c, float m, float y, float k);
  542 void ctx_dcmyka (Ctx *ctx, float c, float m, float y, float k, float a);
  543 void ctx_dcmyk  (Ctx *ctx, float c, float m, float y, float k);
  544 
  545 /* there is also getters for colors, by first setting a color in one format 
  546 and getting
  547  * it with another color conversions can be done
  548  */
  549 
  550 void ctx_get_rgba   (Ctx *ctx, float *rgba);
  551 void ctx_get_graya  (Ctx *ctx, float *ya);
  552 void ctx_get_drgba  (Ctx *ctx, float *drgba);
  553 void ctx_get_cmyka  (Ctx *ctx, float *cmyka);
  554 void ctx_get_dcmyka (Ctx *ctx, float *dcmyka);
  555 int  ctx_in_fill    (Ctx *ctx, float x, float y);
  556 int  ctx_in_stroke  (Ctx *ctx, float x, float y);
  557 
  558 /**
  559  * ctx_linear_gradient:
  560  * Change the source to a linear gradient from x0,y0 to x1 y1, by default 
  561  an empty gradient
  562  * from black to white exist, add stops with ctx_gradient_add_stop to 
  563  specify a custom gradient.
  564  */
  565 void ctx_linear_gradient (Ctx *ctx, float x0, float y0, float x1, float y1);
  566 
  567 /**
  568  * ctx_radial_gradient:
  569  * Change the source to a radial gradient from a circle x0,y0 with radius 
  570  r0 to an outher circle x1, y1 with radius r1. (NOTE: currently ctx is only 
  571  using the second circles origin, both radiuses are in use.)
  572  */
  573 void ctx_radial_gradient (Ctx *ctx, float x0, float y0, float r0,
  574                           float x1, float y1, float r1);
  575 
  576 /* ctx_graident_add_stop:
  577  *
  578  * Add an RGBA gradient stop to the current gradient at position pos.
  579  *
  580  * XXX should be ctx_gradient_add_stop_rgba */
  581 void ctx_gradient_add_stop (Ctx *ctx, float pos, float r, float g, float b, 
  582                             float a);
  583 
  584 /* ctx_graident_add_stop:
  585  *
  586  * Add an RGBA gradient stop to the current gradient at position pos.
  587  *
  588  * XXX should be ctx_gradient_add_stop_u8 */
  589 void ctx_gradient_add_stop_u8 (Ctx *ctx, float pos, uint8_t r, uint8_t g, 
  590                                uint8_t b, uint8_t a);
  591 
  592 /* ctx_define_texture:
  593  */
  594 void ctx_define_texture (Ctx *ctx,
  595                          const char *eid,
  596                          int         width,
  597                          int         height,
  598                          int         stride,
  599                          int         format,
  600                          void       *data,
  601                          char       *ret_eid);
  602 
  603 void ctx_drop_eid (Ctx *ctx, const char *eid);
  604 
  605 /* ctx_source_transform:
  606  */
  607 void
  608 ctx_source_transform (Ctx *ctx, float a, float b,  float c,
  609                       float d, float e, float f, 
  610                       float g, float h, float i); 
  611 typedef struct _CtxMatrix     CtxMatrix;
  612 
  613 /* ctx_source_transform_matrix:
  614  */
  615 void
  616 ctx_source_transform_matrix (Ctx *ctx, CtxMatrix *matrix);
  617 
  618 
  619 
  620 int   ctx_width                (Ctx *ctx);
  621 int   ctx_height               (Ctx *ctx);
  622 float ctx_x                    (Ctx *ctx);
  623 float ctx_y                    (Ctx *ctx);
  624 float ctx_get_global_alpha     (Ctx *ctx);
  625 float ctx_get_font_size        (Ctx *ctx);
  626 float ctx_get_miter_limit      (Ctx *ctx);
  627 int   ctx_get_image_smoothing   (Ctx *ctx);
  628 float ctx_get_line_dash_offset (Ctx *ctx);
  629 
  630 float ctx_get_wrap_left        (Ctx *ctx);
  631 float ctx_get_wrap_right       (Ctx *ctx);
  632 float ctx_get_line_height      (Ctx *ctx);
  633 
  634 const char *ctx_get_font       (Ctx *ctx);
  635 float ctx_get_line_width       (Ctx *ctx);
  636 void  ctx_current_point        (Ctx *ctx, float *x, float *y);
  637 void  ctx_get_transform        (Ctx *ctx, float *a, float *b,
  638                                 float *c, float *d,
  639                                 float *e, float *f,
  640                                 float *g, float *h,
  641                                 float *i);
  642 
  643 void
  644 ctx_clip_extents (Ctx *ctx, float *x0, float *y0,
  645                             float *x1, float *y1);
  646 
  647 /* The pixel formats supported as render targets
  648  */
  649 enum _CtxPixelFormat
  650 {
  651   CTX_FORMAT_NONE=0,
  652   CTX_FORMAT_GRAY8,  // 1  - these enum values are not coincidence
  653   CTX_FORMAT_GRAYA8, // 2  -
  654   CTX_FORMAT_RGB8,   // 3  -
  655   CTX_FORMAT_RGBA8,  // 4  -
  656   CTX_FORMAT_BGRA8,  // 5
  657   CTX_FORMAT_RGB565, // 6
  658   CTX_FORMAT_RGB565_BYTESWAPPED, // 7
  659   CTX_FORMAT_RGB332, // 8 // matching flags
  660   CTX_FORMAT_RGBAF,  // 9
  661   CTX_FORMAT_GRAYF,  // 10
  662   CTX_FORMAT_GRAYAF, // 11
  663   CTX_FORMAT_GRAY1,  // 12
  664   CTX_FORMAT_CMYK8,  // 13
  665   CTX_FORMAT_CMYKAF, // 14
  666   CTX_FORMAT_CMYKA8, // 15 
  667   CTX_FORMAT_GRAY2,  // 16 // matching flags
  668   CTX_FORMAT_YUV420, // 17
  669   CTX_FORMAT_GRAY4=32, // to match flags
  670   CTX_FORMAT_CBRLE_1,   // CBRLE constant bitrate runlength encoded 1 bpp
  671   CTX_FORMAT_CBRLE_2,   // these formats are used internally with the CBRLE
  672   CTX_FORMAT_CBRLE_3,   // flag passed to the cb backend. (should be 
  673                                                            exteneded
  674   CTX_FORMAT_CBRLE_4,   // to also apply to the tiled backends).
  675   CTX_FORMAT_CBRLE_5,   //
  676   CTX_FORMAT_CBRLE_6,   // When used in other backends they determine 
  677   automatically
  678   CTX_FORMAT_CBRLE_7,   // which specific CBRLE format to use, based on 
  679   available
  680   CTX_FORMAT_CBRLE_8,   // memory budget.
  681   CTX_FORMAT_CBRLE_9,   // 
  682   CTX_FORMAT_CBRLE_10,  // The specific formats are also used for testing 
  683   and
  684   CTX_FORMAT_CBRLE_11,  // improving the visual quality vs performance loss
  685   CTX_FORMAT_CBRLE_12,  // when lossy.
  686   CTX_FORMAT_CBRLE_13,  //
  687   CTX_FORMAT_CBRLE_14,  // 
  688   CTX_FORMAT_CBRLE_15,  //
  689   CTX_FORMAT_CBRLE_16,  // 
  690   CTX_FORMAT_CBRLE_17,  //  
  691   CTX_FORMAT_CBRLE_18,  //  
  692   CTX_FORMAT_CBRLE_19,  //  
  693   CTX_FORMAT_CBRLE_20,  //  
  694   CTX_FORMAT_CBRLE_21,  //  
  695   CTX_FORMAT_CBRLE_22,  //  
  696   CTX_FORMAT_CBRLE_23,  //  
  697   CTX_FORMAT_CBRLE_24,  //  
  698   CTX_FORMAT_CBRLE_32,  //  
  699   CTX_FORMAT_CBRLE,     // 
  700   CTX_FORMAT_BGRA8Z,    // 
  701   CTX_FORMAT_RGBA8_SEPARATE_ALPHA, //
  702 };
  703 typedef enum   _CtxPixelFormat CtxPixelFormat;
  704 
  705 /**
  706  * ctx_new_for_framebuffer:
  707  *
  708  * Create a new drawing context for a framebuffer, rendering happens
  709  * immediately.
  710  */
  711 Ctx *ctx_new_for_framebuffer (void *data,
  712                               int   width,
  713                               int   height,
  714                               int   stride,
  715                               CtxPixelFormat pixel_format);
  716 
  717 void
  718 ctx_get_image_data (Ctx *ctx, int sx, int sy, int sw, int sh,
  719                     CtxPixelFormat format, int dst_stride,
  720                     uint8_t *dst_data);
  721 
  722 void
  723 ctx_put_image_data (Ctx *ctx, int w, int h, int stride, int format,
  724                     uint8_t *data,
  725                     int ox, int oy,
  726                     int dirtyX, int dirtyY,
  727                     int dirtyWidth, int dirtyHeight);
  728 
  729 
  730 /* loads an image file from disk into texture, returning pixel width, 
  731 height
  732  * and eid, the eid is based on the path; not the contents - avoiding doing
  733  * sha1 checksum of contents. The width and height of the image is returned
  734  * along with the used eid, width height or eid can be NULL if we
  735  * do not care about their values.
  736  */
  737 void ctx_texture_load (Ctx        *ctx,
  738                        const char *path,
  739                        int        *width,
  740                        int        *height,
  741                        char       *eid);
  742 
  743 /* sets the paint source to be a texture by eid
  744  */
  745 void ctx_texture              (Ctx *ctx, const char *eid, float x, float y);
  746 
  747 void ctx_draw_texture         (Ctx *ctx, const char *eid, float x, float y, 
  748                                float w, float h);
  749 
  750 void ctx_draw_texture_clipped (Ctx *ctx, const char *eid, float x, float y, 
  751                                float w, float h, float sx, float sy, float 
  752                                swidth, float sheight);
  753 
  754 void ctx_draw_image           (Ctx *ctx, const char *path, float x, float y,
  755                                float w, float h);
  756 
  757 void ctx_draw_image_clipped   (Ctx *ctx, const char *path, float x, float y,
  758                                float w, float h, float sx, float sy, float 
  759                                swidth, float sheight);
  760 
  761 /* used by the render threads of fb and sdl backends.
  762  */
  763 void ctx_set_texture_source (Ctx *ctx, Ctx *texture_source);
  764 /* used when sharing cache state of eids between clients
  765  */
  766 void ctx_set_texture_cache (Ctx *ctx, Ctx *texture_cache);
  767 
  768 typedef struct _CtxDrawlist CtxDrawlist;
  769 typedef void (*CtxFullCb) (CtxDrawlist *drawlist, void *data);
  770 
  771 int ctx_pixel_format_bits_per_pixel (CtxPixelFormat format); // bits per 
  772                                      pixel
  773 int ctx_pixel_format_get_stride     (CtxPixelFormat format, int width);
  774 int ctx_pixel_format_components     (CtxPixelFormat format);
  775 
  776 void _ctx_set_store_clear    (Ctx *ctx);
  777 void _ctx_set_transformation (Ctx *ctx, int transformation);
  778 
  779 Ctx *ctx_hasher_new          (int width, int height, int cols, int rows, 
  780                               CtxDrawlist *drawlist);
  781 uint32_t ctx_hasher_get_hash (Ctx *ctx, int col, int row);
  782 
  783 int ctx_utf8_strlen (const char *s);
  784 int ctx_utf8_len (const unsigned char first_byte);
  785 
  786 #ifndef CTX_BABL
  787 #ifdef _BABL_H
  788 #define CTX_BABL 1
  789 #else
  790 #define CTX_BABL 0
  791 #endif
  792 #endif
  793 
  794 /* If cairo.h is included before ctx.h add cairo integration code
  795  */
  796 #ifdef CAIRO_H
  797 #ifndef CTX_CAIRO
  798 #define CTX_CAIRO 1
  799 #endif
  800 #endif
  801 
  802 #ifndef CTX_TFT_ESPI
  803 #ifdef _TFT_eSPIH_
  804 #define CTX_TFT_ESPI 1
  805 #else
  806 #define CTX_TFT_ESPI 0
  807 #endif
  808 #endif
  809 
  810 #ifndef CTX_SDL
  811 #ifdef SDL_h_
  812 #define CTX_SDL 1
  813 #else
  814 #define CTX_SDL 0
  815 #endif
  816 #endif
  817 
  818 #ifndef CTX_FB
  819 #define CTX_FB 0
  820 #endif
  821 
  822 #ifndef CTX_KMS
  823 #define CTX_KMS 0
  824 #endif
  825 
  826 #if CTX_SDL
  827 #define ctx_mutex_t           SDL_mutex
  828 #define ctx_create_mutex()    SDL_CreateMutex()
  829 #define ctx_lock_mutex(a)     SDL_LockMutex(a)
  830 #define ctx_unlock_mutex(a)   SDL_UnlockMutex(a)
  831 #else
  832 #define ctx_mutex_t           int
  833 #define ctx_create_mutex()    NULL
  834 #define ctx_lock_mutex(a)   
  835 #define ctx_unlock_mutex(a)  
  836 #endif
  837 
  838 
  839 /* these are configuration flags for a ctx renderer, not all
  840  * flags are applicable for all rendereres, the cb backend
  841  * has the widest support currently.
  842  */
  843 typedef enum CtxFlags {
  844   //CTX_FLAG_DEFAULTS   = 0,
  845   CTX_FLAG_GRAY8        = 1 << 0, // use GRAY8, implies LOWFI
  846   CTX_FLAG_HASH_CACHE   = 1 << 1, // use a hashcache to determine which 
  847                           parts to redraw, implied by LOWFI
  848   CTX_FLAG_LOWFI        = 1 << 2, // use lower res and color fidelity 
  849                           preview renders
  850   CTX_FLAG_RGB332       = 1 << 3, // 8bit indexed with fixed palette, 
  851                           implies lowfi
  852   CTX_FLAG_GRAY2        = 1 << 4, // 4 level grayscale, implies lowfi
  853   CTX_FLAG_GRAY4        = 1 << 5, // 16 level grayscale, implies lowfi
  854   //CTX_FLAG_DAMAGE_CONTROL = 1 << 6,
  855   CTX_FLAG_SHOW_FPS     = 1 << 7, // possibly show fps in titlebar or 
  856                           printed to a log
  857   CTX_FLAG_KEEP_DATA    = 1 << 8, // keep existing fb-data instead of doing 
  858                           an initial clear
  859   CTX_FLAG_INTRA_UPDATE = 1 << 9,
  860   CTX_FLAG_STAY_LOW     = 1 << 10,  // stay with the color fidelity drop in 
  861                           lowfi
  862   CTX_FLAG_CBRLE        = 1 << 11   // use possibly lossy RLE encoded 
  863                           scanlines with constant bitrate
  864 } CtxFlags;
  865 
  866 
  867 Ctx *ctx_new_cb (int width, int height, CtxPixelFormat format,
  868                  void (*set_pixels) (Ctx *ctx, void *user_data, 
  869                                      int x, int y, int w, int h, void *buf,
  870                                      int buf_size),
  871                  void *set_pixels_user_data,
  872                  int (*update_fb) (Ctx *ctx, void *user_data),
  873                  void *update_fb_user_data,
  874                  int   memory_budget,
  875                  void *scratch_fb,
  876                  int flags);
  877 void ctx_cb_set_flags (Ctx *ctx, int flags);
  878 int ctx_cb_get_flags  (Ctx *ctx);
  879 void ctx_cb_set_memory_budget (Ctx *ctx, int memory_budget);
  880 void
  881 ctx_cb_extent (Ctx *ctx, float *x0, float *y0, float *x1, float *y1);
  882 
  883 #if CTX_TFT_ESPI
  884 Ctx *ctx_new_tft (TFT_eSPI *tft, int memory_budget, void *scratch_fb, int 
  885                   flags);
  886 
  887 #endif
  888 
  889 
  890 #if CTX_CAIRO
  891 #ifndef CAIRO_H
  892 typedef struct _cairo_t cairo_t;
  893 #endif
  894 
  895 /* render the deferred commands of a ctx context to a cairo
  896  * context
  897  */
  898 void  ctx_render_cairo  (Ctx *ctx, cairo_t *cr);
  899 
  900 /* create a ctx context that directly renders to the specified
  901  * cairo context
  902  */
  903 Ctx * ctx_new_for_cairo (cairo_t *cr);
  904 #endif
  905 
  906 char *ctx_render_string (Ctx *ctx, int longform, int *retlen);
  907 
  908 void ctx_render_stream  (Ctx *ctx, FILE *stream, int formatter);
  909 
  910 void ctx_render_ctx     (Ctx *ctx, Ctx *d_ctx);
  911 void ctx_render_ctx_textures (Ctx *ctx, Ctx *d_ctx); /* cycles through all
  912                                                         used texture eids
  913                                                       */
  914 
  915 void ctx_start_move     (Ctx *ctx);
  916 
  917 
  918 int ctx_add_single      (Ctx *ctx, void *entry);
  919 
  920 uint32_t ctx_utf8_to_unichar (const char *input);
  921 int      ctx_unichar_to_utf8 (uint32_t  ch, uint8_t  *dest);
  922 
  923 
  924 typedef enum
  925 {
  926   CTX_FILL_RULE_WINDING = 0,
  927   CTX_FILL_RULE_EVEN_ODD
  928 } CtxFillRule;
  929 
  930 typedef enum
  931 {
  932 #if 0
  933   CTX_COMPOSITE_SOURCE_OVER      = 0,
  934   CTX_COMPOSITE_COPY             = 32,
  935   CTX_COMPOSITE_SOURCE_IN        = 64,
  936   CTX_COMPOSITE_SOURCE_OUT       = 96,
  937   CTX_COMPOSITE_SOURCE_ATOP      = 128,
  938   CTX_COMPOSITE_CLEAR            = 160,
  939 
  940   CTX_COMPOSITE_DESTINATION_OVER = 192,
  941   CTX_COMPOSITE_DESTINATION      = 224,
  942   CTX_COMPOSITE_DESTINATION_IN   = 256,
  943   CTX_COMPOSITE_DESTINATION_OUT  = 288,
  944   CTX_COMPOSITE_DESTINATION_ATOP = 320,
  945   CTX_COMPOSITE_XOR              = 352,
  946   CTX_COMPOSITE_ALL              = (32+64+128+256)
  947 #else
  948   CTX_COMPOSITE_SOURCE_OVER      =0,
  949   CTX_COMPOSITE_COPY             ,
  950   CTX_COMPOSITE_SOURCE_IN        ,
  951   CTX_COMPOSITE_SOURCE_OUT       ,
  952   CTX_COMPOSITE_SOURCE_ATOP      ,
  953   CTX_COMPOSITE_CLEAR            ,
  954 
  955   CTX_COMPOSITE_DESTINATION_OVER ,
  956   CTX_COMPOSITE_DESTINATION      ,
  957   CTX_COMPOSITE_DESTINATION_IN   ,
  958   CTX_COMPOSITE_DESTINATION_OUT  ,
  959   CTX_COMPOSITE_DESTINATION_ATOP ,
  960   CTX_COMPOSITE_XOR              ,
  961 #endif
  962 } CtxCompositingMode;
  963 
  964 typedef enum
  965 {
  966   CTX_BLEND_NORMAL,
  967   CTX_BLEND_MULTIPLY,
  968   CTX_BLEND_SCREEN,
  969   CTX_BLEND_OVERLAY,
  970   CTX_BLEND_DARKEN,
  971   CTX_BLEND_LIGHTEN,
  972   CTX_BLEND_COLOR_DODGE,
  973   CTX_BLEND_COLOR_BURN,
  974   CTX_BLEND_HARD_LIGHT,
  975   CTX_BLEND_SOFT_LIGHT,
  976   CTX_BLEND_DIFFERENCE,
  977   CTX_BLEND_EXCLUSION,
  978   CTX_BLEND_HUE, 
  979   CTX_BLEND_SATURATION, 
  980   CTX_BLEND_COLOR, 
  981   CTX_BLEND_LUMINOSITY,  // 15
  982   CTX_BLEND_DIVIDE,
  983   CTX_BLEND_ADDITION,
  984   CTX_BLEND_SUBTRACT,    // 18
  985 } CtxBlend;
  986 
  987 void ctx_blend_mode (Ctx *ctx, CtxBlend mode);
  988 
  989 typedef enum
  990 {
  991   CTX_JOIN_BEVEL = 0,
  992   CTX_JOIN_ROUND = 1,
  993   CTX_JOIN_MITER = 2
  994 } CtxLineJoin;
  995 
  996 typedef enum
  997 {
  998   CTX_CAP_NONE   = 0,
  999   CTX_CAP_ROUND  = 1,
 1000   CTX_CAP_SQUARE = 2
 1001 } CtxLineCap;
 1002 
 1003 typedef enum
 1004 {
 1005   CTX_EXTEND_NONE    = 0,
 1006   CTX_EXTEND_REPEAT  = 1,
 1007   CTX_EXTEND_REFLECT = 2,
 1008   CTX_EXTEND_PAD     = 3
 1009 } CtxExtend;
 1010 
 1011 void ctx_extend (Ctx *ctx, CtxExtend extend);
 1012 
 1013 typedef enum
 1014 {
 1015   CTX_TEXT_BASELINE_ALPHABETIC = 0,
 1016   CTX_TEXT_BASELINE_TOP,
 1017   CTX_TEXT_BASELINE_HANGING,
 1018   CTX_TEXT_BASELINE_MIDDLE,
 1019   CTX_TEXT_BASELINE_IDEOGRAPHIC,
 1020   CTX_TEXT_BASELINE_BOTTOM
 1021 } CtxTextBaseline;
 1022 
 1023 typedef enum
 1024 {
 1025   CTX_TEXT_ALIGN_START = 0,  // in mrg these didnt exist
 1026   CTX_TEXT_ALIGN_END,        // but left/right did
 1027   CTX_TEXT_ALIGN_JUSTIFY, // not handled in ctx
 1028   CTX_TEXT_ALIGN_CENTER,
 1029   CTX_TEXT_ALIGN_LEFT,
 1030   CTX_TEXT_ALIGN_RIGHT
 1031 } CtxTextAlign;
 1032 
 1033 typedef enum
 1034 {
 1035   CTX_TEXT_DIRECTION_INHERIT = 0,
 1036   CTX_TEXT_DIRECTION_LTR,
 1037   CTX_TEXT_DIRECTION_RTL
 1038 } CtxTextDirection;
 1039 
 1040 struct
 1041 _CtxGlyph
 1042 {
 1043   uint32_t index;
 1044   float    x;
 1045   float    y;
 1046 };
 1047 
 1048 CtxTextAlign       ctx_get_text_align (Ctx *ctx);
 1049 CtxTextBaseline    ctx_get_text_baseline (Ctx *ctx);
 1050 CtxTextDirection   ctx_get_text_direction (Ctx *ctx);
 1051 CtxFillRule        ctx_get_fill_rule (Ctx *ctx);
 1052 CtxLineCap         ctx_get_line_cap (Ctx *ctx);
 1053 CtxLineJoin        ctx_get_line_join (Ctx *ctx);
 1054 CtxCompositingMode ctx_get_compositing_mode (Ctx *ctx);
 1055 CtxBlend           ctx_get_blend_mode (Ctx *ctx);
 1056 CtxExtend          ctx_get_extend     (Ctx *ctx);
 1057 
 1058 void ctx_gradient_add_stop_string (Ctx *ctx, float pos, const char *color);
 1059 
 1060 void ctx_text_align           (Ctx *ctx, CtxTextAlign      align);
 1061 void ctx_text_baseline        (Ctx *ctx, CtxTextBaseline   baseline);
 1062 void ctx_text_direction       (Ctx *ctx, CtxTextDirection  direction);
 1063 void ctx_fill_rule            (Ctx *ctx, CtxFillRule       fill_rule);
 1064 void ctx_line_cap             (Ctx *ctx, CtxLineCap        cap);
 1065 void ctx_line_join            (Ctx *ctx, CtxLineJoin       join);
 1066 void ctx_compositing_mode     (Ctx *ctx, CtxCompositingMode mode);
 1067 /* we only care about the tight packing for this specific
 1068  * struct as we do indexing across members in arrays of it,
 1069  * to make sure its size becomes 9bytes -
 1070  * the pack pragma is also sufficient on recent gcc versions
 1071  */
 1072 #pragma pack(push,1)
 1073 struct
 1074   _CtxEntry
 1075 {
 1076   uint8_t code;
 1077   union
 1078   {
 1079     float    f[2];
 1080     uint8_t  u8[8];
 1081     int8_t   s8[8];
 1082     uint16_t u16[4];
 1083     int16_t  s16[4];
 1084     uint32_t u32[2];
 1085     int32_t  s32[2];
 1086     uint64_t u64[1]; // unused
 1087   } data; // 9bytes long, we're favoring compactness and correctness
 1088   // over performance. By sacrificing float precision, zeroing
 1089   // first 8bit of f[0] would permit 8bytes long and better
 1090   // aglinment and cacheline behavior.
 1091 };
 1092 #pragma pack(pop)
 1093 
 1094 
 1095 void  ctx_text          (Ctx        *ctx,
 1096                          const char *string);
 1097 void  ctx_text_stroke   (Ctx        *ctx,
 1098                          const char *string);
 1099 
 1100 // XXX do not use?
 1101 void  ctx_fill_text     (Ctx        *ctx,
 1102                          const char *string,
 1103                          float       x,
 1104                          float       y);
 1105 
 1106 // XXX do not use?
 1107 void  ctx_stroke_text   (Ctx        *ctx,
 1108                          const char *string,
 1109                          float       x,
 1110                          float       y);
 1111 
 1112 /* returns the total horizontal advance if string had been rendered */
 1113 float ctx_text_width    (Ctx        *ctx,
 1114                          const char *string);
 1115 
 1116 float ctx_glyph_width   (Ctx *ctx, int unichar);
 1117 
 1118 int   ctx_load_font_ttf (const char *name, const void *ttf_contents, int 
 1119                          length);
 1120 
 1121 
 1122 /**
 1123  * ctx_dirty_rect:
 1124  *
 1125  * Query the dirtied bounding box of drawing commands thus far.
 1126  */
 1127 void  ctx_dirty_rect      (Ctx *ctx, int *x, int *y, int *width, int 
 1128                            *height);
 1129 
 1130 
 1131 #ifdef CTX_X86_64
 1132 int ctx_x86_64_level (void);
 1133 #endif
 1134 
 1135 
 1136 enum _CtxModifierState
 1137 {
 1138   CTX_MODIFIER_STATE_SHIFT   = (1<<0),
 1139   CTX_MODIFIER_STATE_CONTROL = (1<<1),
 1140   CTX_MODIFIER_STATE_ALT     = (1<<2),
 1141   CTX_MODIFIER_STATE_BUTTON1 = (1<<3),
 1142   CTX_MODIFIER_STATE_BUTTON2 = (1<<4),
 1143   CTX_MODIFIER_STATE_BUTTON3 = (1<<5),
 1144   CTX_MODIFIER_STATE_DRAG    = (1<<6), // pointer button is down (0 or any)
 1145 };
 1146 typedef enum _CtxModifierState CtxModifierState;
 1147 
 1148 enum _CtxScrollDirection
 1149 {
 1150   CTX_SCROLL_DIRECTION_UP,
 1151   CTX_SCROLL_DIRECTION_DOWN,
 1152   CTX_SCROLL_DIRECTION_LEFT,
 1153   CTX_SCROLL_DIRECTION_RIGHT
 1154 };
 1155 typedef enum _CtxScrollDirection CtxScrollDirection;
 1156 
 1157 typedef struct _CtxEvent CtxEvent;
 1158 
 1159 void ctx_set_backend (Ctx *ctx, void *backend);
 1160 void *ctx_get_backend (Ctx *ctx);
 1161 
 1162 /* the following API is only available when CTX_EVENTS is defined to 1
 1163  *
 1164  * it provides the ability to register callbacks with the current path
 1165  * that get delivered with transformed coordinates.
 1166  */
 1167 int ctx_need_redraw (Ctx *ctx);
 1168 void ctx_queue_draw (Ctx *ctx);
 1169 float ctx_get_float (Ctx *ctx, uint32_t hash);
 1170 void ctx_set_float (Ctx *ctx, uint32_t hash, float value);
 1171 
 1172 unsigned long ctx_ticks (void);
 1173 void ctx_end_frame (Ctx *ctx);
 1174 
 1175 void ctx_set_clipboard (Ctx *ctx, const char *text);
 1176 char *ctx_get_clipboard (Ctx *ctx);
 1177 
 1178 void _ctx_events_init     (Ctx *ctx);
 1179 typedef struct _CtxIntRectangle CtxIntRectangle;
 1180 struct _CtxIntRectangle {
 1181   int x;
 1182   int y;
 1183   int width;
 1184   int height;
 1185 };
 1186 
 1187 void ctx_quit (Ctx *ctx);
 1188 int  ctx_has_quit (Ctx *ctx);
 1189 
 1190 typedef void (*CtxCb) (CtxEvent *event,
 1191                        void     *data,
 1192                        void     *data2);
 1193 typedef void (*CtxDestroyNotify) (void *data);
 1194 
 1195 enum _CtxEventType {
 1196   CTX_PRESS        = 1 << 0,
 1197   CTX_MOTION       = 1 << 1,
 1198   CTX_RELEASE      = 1 << 2,
 1199   CTX_ENTER        = 1 << 3,
 1200   CTX_LEAVE        = 1 << 4,
 1201   CTX_TAP          = 1 << 5,
 1202   CTX_TAP_AND_HOLD = 1 << 6,
 1203 
 1204   /* NYI: SWIPE, ZOOM ROT_ZOOM, */
 1205 
 1206   CTX_DRAG_PRESS   = 1 << 7,
 1207   CTX_DRAG_MOTION  = 1 << 8,
 1208   CTX_DRAG_RELEASE = 1 << 9,
 1209   CTX_KEY_PRESS    = 1 << 10,
 1210   CTX_KEY_DOWN     = 1 << 11,
 1211   CTX_KEY_UP       = 1 << 12,
 1212   CTX_SCROLL       = 1 << 13,
 1213   CTX_MESSAGE      = 1 << 14,
 1214   CTX_DROP         = 1 << 15,
 1215 
 1216   CTX_SET_CURSOR   = 1 << 16, // used internally
 1217 
 1218   /* client should store state - preparing
 1219                                  * for restart
 1220                                  */
 1221   CTX_POINTER  = (CTX_PRESS | CTX_MOTION | CTX_RELEASE | CTX_DROP),
 1222   CTX_TAPS     = (CTX_TAP | CTX_TAP_AND_HOLD),
 1223   CTX_CROSSING = (CTX_ENTER | CTX_LEAVE),
 1224   CTX_DRAG     = (CTX_DRAG_PRESS | CTX_DRAG_MOTION | CTX_DRAG_RELEASE),
 1225   CTX_KEY      = (CTX_KEY_DOWN | CTX_KEY_UP | CTX_KEY_PRESS),
 1226   CTX_MISC     = (CTX_MESSAGE),
 1227   CTX_ANY      = (CTX_POINTER | CTX_DRAG | CTX_CROSSING | CTX_KEY | 
 1228                  CTX_MISC | CTX_TAPS),
 1229 };
 1230 typedef enum _CtxEventType CtxEventType;
 1231 
 1232 #define CTX_CLICK   CTX_PRESS   // SHOULD HAVE MORE LOGIC
 1233 typedef struct _CtxClient CtxClient;
 1234 
 1235 
 1236 
 1237 struct _CtxEvent {
 1238   CtxEventType  type;
 1239   uint32_t time;
 1240   Ctx     *ctx;
 1241   int stop_propagate; /* when set - propagation is stopped */
 1242 
 1243   CtxModifierState state;
 1244 
 1245   int     device_no; /* 0 = left mouse button / virtual focus */
 1246                      /* 1 = middle mouse button */
 1247                      /* 2 = right mouse button */
 1248                      /* 3 = first multi-touch .. (NYI) */
 1249 
 1250   float   device_x; /* untransformed (device) coordinates  */
 1251   float   device_y;
 1252 
 1253   /* coordinates; and deltas for motion/drag events in user-coordinates: */
 1254   float   x;
 1255   float   y;
 1256   float   start_x; /* start-coordinates (press) event for drag, */
 1257   float   start_y; /*    untransformed coordinates */
 1258   float   prev_x;  /* previous events coordinates */
 1259   float   prev_y;
 1260   float   delta_x; /* x - prev_x, redundant - but often useful */
 1261   float   delta_y; /* y - prev_y, redundant - ..  */
 1262 
 1263 
 1264   unsigned int unicode; /* only valid for key-events, re-use as keycode? */
 1265   const char *string;   /* as key can be "up" "down" "space" "backspace" 
 1266   "a" "b" "ø" etc .. */
 1267                         /* this is also where the message is delivered for
 1268                          * MESSAGE events
 1269                          *
 1270                          * and the data for drop events are delivered
 1271                          *
 1272                          */
 1273                          /* XXX lifetime of this string should be longer
 1274                          * than the events, preferably interned. XXX
 1275                          * maybe add a flag for this?
 1276                          */
 1277   int owns_string; /* if 1 call free.. */
 1278   CtxScrollDirection scroll_direction;
 1279 
 1280 
 1281   // would be nice to add the bounding box of the hit-area causing
 1282   // the event, making for instance scissored enter/leave repaint easier.
 1283 };
 1284 
 1285 // layer-event "layer"  motion x y device_no 
 1286 
 1287 void ctx_add_key_binding_full (Ctx *ctx,
 1288                                const char *key,
 1289                                const char *action,
 1290                                const char *label,
 1291                                CtxCb       cb,
 1292                                void       *cb_data,
 1293                                CtxDestroyNotify destroy_notify,
 1294                                void       *destroy_data);
 1295 void ctx_add_key_binding (Ctx *ctx,
 1296                           const char *key,
 1297                           const char *action,
 1298                           const char *label,
 1299                           CtxCb cb,
 1300                           void  *cb_data);
 1301 typedef struct CtxBinding {
 1302   char *nick;
 1303   char *command;
 1304   char *label;
 1305   CtxCb cb;
 1306   void *cb_data;
 1307   CtxDestroyNotify destroy_notify;
 1308   void  *destroy_data;
 1309 } CtxBinding;
 1310 CtxBinding *ctx_get_bindings (Ctx *ctx);
 1311 void  ctx_clear_bindings     (Ctx *ctx);
 1312 void  ctx_remove_idle        (Ctx *ctx, int handle);
 1313 int   ctx_add_timeout_full   (Ctx *ctx, int ms, int (*idle_cb)(Ctx *ctx, 
 1314                               void *idle_data), void *idle_data,
 1315                               void (*destroy_notify)(void *destroy_data), 
 1316                                     void *destroy_data);
 1317 int   ctx_add_timeout        (Ctx *ctx, int ms, int (*idle_cb)(Ctx *ctx, 
 1318                               void *idle_data), void *idle_data);
 1319 int   ctx_add_idle_full      (Ctx *ctx, int (*idle_cb)(Ctx *ctx, void 
 1320                               *idle_data), void *idle_data,
 1321                               void (*destroy_notify)(void *destroy_data), 
 1322                                     void *destroy_data);
 1323 int   ctx_add_idle           (Ctx *ctx, int (*idle_cb)(Ctx *ctx, void 
 1324                               *idle_data), void *idle_data);
 1325 
 1326 
 1327 void ctx_add_hit_region (Ctx *ctx, const char *id);
 1328 
 1329 void ctx_listen_full (Ctx     *ctx,
 1330                       float    x,
 1331                       float    y,
 1332                       float    width,
 1333                       float    height,
 1334                       CtxEventType  types,
 1335                       CtxCb    cb,
 1336                       void    *data1,
 1337                       void    *data2,
 1338                       void   (*finalize)(void *listen_data, void 
 1339                               *listen_data2,
 1340                                          void *finalize_data),
 1341                       void    *finalize_data);
 1342 void  ctx_event_stop_propagate (CtxEvent *event);
 1343 void  ctx_listen               (Ctx          *ctx,
 1344                                 CtxEventType  types,
 1345                                 CtxCb         cb,
 1346                                 void*         data1,
 1347                                 void*         data2);
 1348 void  ctx_listen_with_finalize (Ctx          *ctx,
 1349                                 CtxEventType  types,
 1350                                 CtxCb         cb,
 1351                                 void*         data1,
 1352                                 void*         data2,
 1353                       void   (*finalize)(void *listen_data, void 
 1354                               *listen_data2,
 1355                                          void *finalize_data),
 1356                       void    *finalize_data);
 1357 
 1358 void ctx_init (int *argc, char ***argv); // is a no-op but could launch
 1359                                          // terminal
 1360 CtxEvent *ctx_get_event (Ctx *ctx);
 1361 void      ctx_get_event_fds (Ctx *ctx, int *fd, int *count);
 1362 
 1363 
 1364 int   ctx_pointer_is_down (Ctx *ctx, int no);
 1365 float ctx_pointer_x (Ctx *ctx);
 1366 float ctx_pointer_y (Ctx *ctx);
 1367 void  ctx_freeze (Ctx *ctx);
 1368 void  ctx_thaw   (Ctx *ctx);
 1369 int   ctx_events_frozen (Ctx *ctx);
 1370 void  ctx_events_clear_items (Ctx *ctx);
 1371 
 1372 /* The following functions drive the event delivery, registered callbacks
 1373  * are called in response to these being called.
 1374  */
 1375 
 1376 int ctx_key_down  (Ctx *ctx, unsigned int keyval,
 1377                    const char *string, uint32_t time);
 1378 int ctx_key_up    (Ctx *ctx, unsigned int keyval,
 1379                    const char *string, uint32_t time);
 1380 int ctx_key_press (Ctx *ctx, unsigned int keyval,
 1381                    const char *string, uint32_t time);
 1382 int ctx_scrolled  (Ctx *ctx, float x, float y, CtxScrollDirection 
 1383                    scroll_direction, uint32_t time);
 1384 void ctx_incoming_message (Ctx *ctx, const char *message, long time);
 1385 int ctx_pointer_motion    (Ctx *ctx, float x, float y, int device_no, 
 1386                            uint32_t time);
 1387 int ctx_pointer_release   (Ctx *ctx, float x, float y, int device_no, 
 1388                            uint32_t time);
 1389 int ctx_pointer_press     (Ctx *ctx, float x, float y, int device_no, 
 1390                            uint32_t time);
 1391 int ctx_pointer_drop      (Ctx *ctx, float x, float y, int device_no, 
 1392                            uint32_t time,
 1393                            char *string);
 1394 
 1395 
 1396 
 1397 int   ctx_client_resize        (Ctx *ctx, int id, int width, int height);
 1398 void  ctx_client_set_font_size (Ctx *ctx, int id, float font_size);
 1399 float ctx_client_get_font_size (Ctx *ctx, int id);
 1400 void  ctx_client_maximize      (Ctx *ctx, int id);
 1401 
 1402 
 1403 #if 1 // CTX_VT
 1404 
 1405 typedef struct _VT VT;
 1406 void vt_feed_keystring    (VT *vt, CtxEvent *event, const char *str);
 1407 void vt_paste             (VT *vt, const char *str);
 1408 char *vt_get_selection    (VT *vt);
 1409 long vt_rev               (VT *vt);
 1410 int  vt_has_blink         (VT *vt);
 1411 int ctx_vt_had_alt_screen (VT *vt);
 1412 
 1413 int ctx_clients_handle_events (Ctx *ctx);
 1414 
 1415 typedef struct _CtxList CtxList;
 1416 CtxList *ctx_clients (Ctx *ctx);
 1417 
 1418 void ctx_set_fullscreen (Ctx *ctx, int val);
 1419 int ctx_get_fullscreen (Ctx *ctx);
 1420 
 1421 typedef struct _CtxBuffer CtxBuffer;
 1422 CtxBuffer *ctx_buffer_new_for_data (void *data, int width, int height,
 1423                                     int stride,
 1424                                     CtxPixelFormat pixel_format,
 1425                                     void (*freefunc) (void *pixels, void 
 1426                                           *user_data),
 1427                                     void *user_data);
 1428 
 1429 typedef enum CtxBackendType {
 1430   CTX_BACKEND_NONE,
 1431   CTX_BACKEND_CTX,
 1432   CTX_BACKEND_RASTERIZER,
 1433   CTX_BACKEND_HASHER,
 1434   CTX_BACKEND_HEADLESS,
 1435   CTX_BACKEND_TERM,
 1436   CTX_BACKEND_FB,
 1437   CTX_BACKEND_KMS,
 1438   CTX_BACKEND_TERMIMG,
 1439   CTX_BACKEND_CAIRO,
 1440   CTX_BACKEND_SDL,
 1441   CTX_BACKEND_DRAWLIST,
 1442 } CtxBackendType;
 1443 
 1444 CtxBackendType ctx_backend_type (Ctx *ctx);
 1445 
 1446 static inline int ctx_backend_is_tiled (Ctx *ctx)
 1447 {
 1448   switch (ctx_backend_type (ctx))
 1449   {
 1450     case CTX_BACKEND_FB:
 1451     case CTX_BACKEND_SDL:
 1452     case CTX_BACKEND_KMS:
 1453     case CTX_BACKEND_HEADLESS:
 1454       return 1;
 1455     default:
 1456       return 0;
 1457   }
 1458 }
 1459 
 1460 #endif
 1461 
 1462 typedef enum CtxClientFlags {
 1463   ITK_CLIENT_UI_RESIZABLE = 1<<0,
 1464   ITK_CLIENT_CAN_LAUNCH   = 1<<1,
 1465   ITK_CLIENT_MAXIMIZED    = 1<<2,
 1466   ITK_CLIENT_ICONIFIED    = 1<<3,
 1467   ITK_CLIENT_SHADED       = 1<<4,
 1468   ITK_CLIENT_TITLEBAR     = 1<<5,
 1469   ITK_CLIENT_LAYER2       = 1<<6,  // used for having a second set
 1470                                    // to draw - useful for splitting
 1471                                    // scrolled and HUD items
 1472                                    // with HUD being LAYER2
 1473                                   
 1474   ITK_CLIENT_KEEP_ALIVE   = 1<<7,  // do not automatically
 1475   ITK_CLIENT_FINISHED     = 1<<8,  // do not automatically
 1476                                    // remove after process quits
 1477   ITK_CLIENT_PRELOAD      = 1<<9,
 1478   ITK_CLIENT_LIVE         = 1<<10
 1479 } CtxClientFlags;
 1480 typedef void (*CtxClientFinalize)(CtxClient *client, void *user_data);
 1481 
 1482 int ctx_client_id (CtxClient *client);
 1483 int ctx_client_flags (CtxClient *client);
 1484 VT *ctx_client_vt (CtxClient *client);
 1485 void ctx_client_add_event (CtxClient *client, CtxEvent *event);
 1486 const char *ctx_client_title (CtxClient *client);
 1487 CtxClient *ctx_client_find (Ctx *ctx, const char *label); // XXX really 
 1488                             unstable api?
 1489 
 1490 
 1491 void *ctx_client_userdata (CtxClient *client);
 1492 
 1493 void ctx_client_quit (CtxClient *client);
 1494 CtxClient *vt_get_client (VT *vt);
 1495 CtxClient *ctx_client_new (Ctx *ctx,
 1496                            const char *commandline,
 1497                            int x, int y, int width, int height,
 1498                            float font_size,
 1499                            CtxClientFlags flags,
 1500                            void *user_data,
 1501                            CtxClientFinalize client_finalize);
 1502 
 1503 CtxClient *ctx_client_new_argv (Ctx *ctx, char **argv, int x, int y, int 
 1504                                 width, int height, float font_size, 
 1505                                 CtxClientFlags flags, void *user_data,
 1506                 CtxClientFinalize client_finalize);
 1507 int ctx_clients_need_redraw (Ctx *ctx);
 1508 
 1509 CtxClient *ctx_client_new_thread (Ctx *ctx, void (*start_routine)(Ctx *ctx, 
 1510                                   void *user_data),
 1511                                   int x, int y, int width, int height, 
 1512                                   float font_size, CtxClientFlags flags, 
 1513                                   void *user_data, CtxClientFinalize 
 1514                                   finalize);
 1515 
 1516 extern float ctx_shape_cache_rate;
 1517 extern int _ctx_max_threads;
 1518 
 1519 CtxEvent *ctx_event_copy (CtxEvent *event);
 1520 
 1521 void  ctx_client_move         (Ctx *ctx, int id, int x, int y);
 1522 void  ctx_client_shade_toggle (Ctx *ctx, int id);
 1523 float ctx_client_min_y_pos    (Ctx *ctx);
 1524 float ctx_client_max_y_pos    (Ctx *ctx);
 1525 void ctx_client_paste (Ctx *ctx, int id, const char *str);
 1526 char  *ctx_client_get_selection        (Ctx *ctx, int id);
 1527 
 1528 void  ctx_client_rev_inc      (CtxClient *client);
 1529 long  ctx_client_rev          (CtxClient *client);
 1530 
 1531 int   ctx_clients_active      (Ctx *ctx);
 1532 
 1533 CtxClient *ctx_client_by_id (Ctx *ctx, int id);
 1534 
 1535 int ctx_clients_draw (Ctx *ctx, int layer2);
 1536 
 1537 void ctx_client_feed_keystring (CtxClient *client, CtxEvent *event, const 
 1538                                 char *str);
 1539 // need not be public?
 1540 void ctx_client_register_events (CtxClient *client, Ctx *ctx, double x0, 
 1541                                  double y0);
 1542 
 1543 void ctx_client_remove (Ctx *ctx, CtxClient *client);
 1544 
 1545 int  ctx_client_height           (Ctx *ctx, int id);
 1546 int  ctx_client_x                (Ctx *ctx, int id);
 1547 int  ctx_client_y                (Ctx *ctx, int id);
 1548 void ctx_client_raise_top        (Ctx *ctx, int id);
 1549 void ctx_client_lower_bottom     (Ctx *ctx, int id);
 1550 void ctx_client_iconify          (Ctx *ctx, int id);
 1551 int  ctx_client_is_iconified     (Ctx *ctx, int id);
 1552 void ctx_client_uniconify        (Ctx *ctx, int id);
 1553 void ctx_client_maximize         (Ctx *ctx, int id);
 1554 int  ctx_client_is_maximized     (Ctx *ctx, int id);
 1555 void ctx_client_unmaximize       (Ctx *ctx, int id);
 1556 void ctx_client_maximized_toggle (Ctx *ctx, int id);
 1557 void ctx_client_shade            (Ctx *ctx, int id);
 1558 int  ctx_client_is_shaded        (Ctx *ctx, int id);
 1559 void ctx_client_unshade          (Ctx *ctx, int id);
 1560 void ctx_client_toggle_maximized (Ctx *ctx, int id);
 1561 void ctx_client_shade_toggle     (Ctx *ctx, int id);
 1562 void ctx_client_move             (Ctx *ctx, int id, int x, int y);
 1563 int  ctx_client_resize           (Ctx *ctx, int id, int width, int height);
 1564 void ctx_client_set_opacity      (Ctx *ctx, int id, float opacity);
 1565 float ctx_client_get_opacity     (Ctx *ctx, int id);
 1566 void ctx_client_set_title        (Ctx *ctx, int id, const char *title);
 1567 const char *ctx_client_get_title (Ctx *ctx, int id);
 1568 
 1569 typedef enum
 1570 {
 1571   CTX_CONT             = '\0', // - contains args from preceding entry
 1572   CTX_NOP              = ' ', //
 1573                    //     !    UNUSED
 1574                    //     "    start/end string
 1575                    //     #    comment in parser
 1576                    //     $    UNUSED
 1577                    //     %    percent of viewport width or height
 1578   CTX_EDGE             = '&', // not occuring in commandstream
 1579                    //     '    start/end string
 1580   CTX_DATA             = '(', // size size-in-entries - u32
 1581   CTX_DATA_REV         = ')', // reverse traversal data marker
 1582   CTX_SET_RGBA_U8      = '*', // r g b a - u8
 1583   CTX_NEW_EDGE         = '+', // x0 y0 x1 y1 - s16
 1584                    //     ,    UNUSED/RESERVED
 1585   CTX_SET_PIXEL        = '-', // 8bit "fast-path" r g b a x y - u8 for rgba,
 1586                          and u16 for x,y
 1587   // set pixel might want a shorter ascii form with hex-color? or keep it 
 1588   an embedded
 1589   // only option?
 1590                    //     .    decimal seperator
 1591                    //     /    UNUSED
 1592  
 1593   /* optimizations that reduce the number of entries used,
 1594    * not visible outside the drawlist compression, thus
 1595    * using entries that cannot be used directly as commands
 1596    * since they would be interpreted as numbers - if values>127
 1597    * then the embedded font data is harder to escape.
 1598    */
 1599   CTX_REL_LINE_TO_X4            = '0', // x1 y1 x2 y2 x3 y3 x4 y4   -- s8
 1600   CTX_REL_LINE_TO_REL_CURVE_TO  = '1', // x1 y1 cx1 cy1 cx2 cy2 x y -- s8
 1601   CTX_REL_CURVE_TO_REL_LINE_TO  = '2', // cx1 cy1 cx2 cy2 x y x1 y1 -- s8
 1602   CTX_REL_CURVE_TO_REL_MOVE_TO  = '3', // cx1 cy1 cx2 cy2 x y x1 y1 -- s8
 1603   CTX_REL_LINE_TO_X2            = '4', // x1 y1 x2 y2 -- s16
 1604   CTX_MOVE_TO_REL_LINE_TO       = '5', // x1 y1 x2 y2 -- s16
 1605   CTX_REL_LINE_TO_REL_MOVE_TO   = '6', // x1 y1 x2 y2 -- s16
 1606   CTX_FILL_MOVE_TO              = '7', // x y
 1607   CTX_REL_QUAD_TO_REL_QUAD_TO   = '8', // cx1 x1 cy1 y1 cx1 x2 cy1 y1 -- s8
 1608   CTX_REL_QUAD_TO_S16           = '9', // cx1 cy1 x y                 - s16
 1609                    //     :    UNUSED
 1610   CTX_END_FRAME        = ';',
 1611                    //     <    UNUSED
 1612                    //     =    UNUSED/RESERVED
 1613                    //     >    UNUSED
 1614                    //     ?    UNUSED
 1615 
 1616   CTX_DEFINE_FONT      = 15,
 1617 
 1618   CTX_DEFINE_GLYPH     = '@', // unichar width - u32
 1619   CTX_ARC_TO           = 'A', // x1 y1 x2 y2 radius
 1620   CTX_ARC              = 'B', // x y radius angle1 angle2 direction
 1621   CTX_CURVE_TO         = 'C', // cx1 cy1 cx2 cy2 x y
 1622   CTX_PAINT            = 'D', // 
 1623   CTX_STROKE           = 'E', //
 1624   CTX_FILL             = 'F', //
 1625   CTX_RESTORE          = 'G', //
 1626   CTX_HOR_LINE_TO      = 'H', // x
 1627   CTX_DEFINE_TEXTURE   = 'I', // "eid" width height format "data"
 1628   CTX_ROTATE           = 'J', // radians
 1629   CTX_COLOR            = 'K', // model, c1 c2 c3 ca - variable arg count
 1630   CTX_LINE_TO          = 'L', // x y
 1631   CTX_MOVE_TO          = 'M', // x y
 1632   CTX_BEGIN_PATH       = 'N', //
 1633   CTX_SCALE            = 'O', // xscale yscale
 1634   CTX_NEW_PAGE         = 'P', // - NYI - optional page-size
 1635   CTX_QUAD_TO          = 'Q', // cx cy x y
 1636   CTX_VIEW_BOX         = 'R', // x y width height
 1637   CTX_SMOOTH_TO        = 'S', // cx cy x y
 1638   CTX_SMOOTHQ_TO       = 'T', // x y
 1639   CTX_START_FRAME      = 'U', // XXX does this belong here?
 1640   CTX_VER_LINE_TO      = 'V', // y
 1641   CTX_APPLY_TRANSFORM  = 'W', // a b c d e f g h i j - for set_transform 
 1642                          combine with identity
 1643   CTX_EXIT             = 'X', //
 1644   CTX_ROUND_RECTANGLE  = 'Y', // x y width height radius
 1645 
 1646   CTX_CLOSE_PATH2      = 'Z', //
 1647   CTX_KERNING_PAIR     = '[', // glA glB kerning, glA and glB in u16 
 1648                          kerning in s32
 1649                        // \   UNUSED
 1650                        // ^   PARSER - vh unit
 1651   CTX_COLOR_SPACE      = ']', // IccSlot  data  data_len,
 1652                          //    data can be a string with a name,
 1653                          //    icc data or perhaps our own serialization
 1654                          //    of profile data
 1655   CTX_EDGE_FLIPPED     = '^', // x0 y0 x1 y1 - s16  | also unit
 1656   CTX_STROKE_SOURCE    = '_', // next source definition applies to strokes
 1657   CTX_SOURCE_TRANSFORM = '`',
 1658   CTX_REL_ARC_TO       = 'a', // x1 y1 x2 y2 radius
 1659   CTX_CLIP             = 'b',
 1660   CTX_REL_CURVE_TO     = 'c', // cx1 cy1 cx2 cy2 x y
 1661   CTX_LINE_DASH        = 'd', // dashlen0 [dashlen1 ...]
 1662   CTX_TRANSLATE        = 'e', // x y
 1663   CTX_LINEAR_GRADIENT  = 'f', // x1 y1 x2 y2
 1664   CTX_SAVE             = 'g',
 1665   CTX_REL_HOR_LINE_TO  = 'h', // x
 1666   CTX_TEXTURE          = 'i',
 1667   CTX_PRESERVE         = 'j', // XXX - fix!
 1668   CTX_SET_KEY          = 'k', // - used together with another char to 
 1669                          identify
 1670                               //   a key to set
 1671   CTX_REL_LINE_TO      = 'l', // x y
 1672   CTX_REL_MOVE_TO      = 'm', // x y
 1673   CTX_FONT             = 'n', // as used by text parser XXX: move to 
 1674                          keyvals?
 1675   CTX_RADIAL_GRADIENT  = 'o', // x1 y1 radius1 x2 y2 radius2
 1676   CTX_GRADIENT_STOP    = 'p', // argument count depends on current color 
 1677                          model
 1678   CTX_REL_QUAD_TO      = 'q', // cx cy x y
 1679   CTX_RECTANGLE        = 'r', // x y width height
 1680   CTX_REL_SMOOTH_TO    = 's', // cx cy x y
 1681   CTX_REL_SMOOTHQ_TO   = 't', // x y
 1682   CTX_STROKE_TEXT      = 'u', // string - utf8 string
 1683   CTX_REL_VER_LINE_TO  = 'v', // y
 1684   CTX_GLYPH            = 'w', // unichar fontsize
 1685   CTX_TEXT             = 'x', // string | kern - utf8 data to shape or 
 1686                          horizontal kerning amount
 1687   CTX_IDENTITY         = 'y', // XXX remove?
 1688   CTX_CLOSE_PATH       = 'z', //
 1689   CTX_START_GROUP      = '{',
 1690                        // |    UNUSED
 1691   CTX_END_GROUP        = '}',
 1692                        // ~    UNUSED/textenc
 1693 
 1694 
 1695   /* though expressed as two chars in serialization we have
 1696    * dedicated byte commands for the setters to keep the dispatch
 1697    * simpler. There is no need for these to be human readable thus we go >
 1698    128
 1699    * they also should not be emitted when outputting, even compact mode ctx.
 1700    *
 1701    * rasterizer:    &^+
 1702    * font:          @[
 1703    *
 1704    * unused:        !&<=>?: =/\`,
 1705    * reserved:      '"&   #. %^@
 1706    */
 1707 
 1708   CTX_FILL_RULE        = 128, // kr rule - u8, default = 
 1709                          CTX_FILLE_RULE_EVEN_ODD
 1710   CTX_BLEND_MODE       = 129, // kB mode - u32 , default=0
 1711 
 1712   CTX_MITER_LIMIT      = 130, // km limit - float, default = 0.0
 1713 
 1714   CTX_LINE_JOIN        = 131, // kj join - u8 , default=0
 1715   CTX_LINE_CAP         = 132, // kc cap - u8, default = 0
 1716   CTX_LINE_WIDTH       = 133, // kw width, default = 2.0
 1717   CTX_GLOBAL_ALPHA     = 134, // ka alpha - default=1.0
 1718   CTX_COMPOSITING_MODE = 135, // kc mode - u32 , default=0
 1719 
 1720   CTX_FONT_SIZE        = 136, // kf size - float, default=?
 1721   CTX_TEXT_ALIGN       = 137, // kt align - u8, default = 
 1722                          CTX_TEXT_ALIGN_START
 1723   CTX_TEXT_BASELINE    = 138, // kb baseline - u8, default = 
 1724                          CTX_TEXT_ALIGN_ALPHABETIC
 1725   CTX_TEXT_DIRECTION   = 139, // kd
 1726 
 1727   CTX_SHADOW_BLUR      = 140, // ks
 1728   CTX_SHADOW_COLOR     = 141, // kC
 1729   CTX_SHADOW_OFFSET_X  = 142, // kx
 1730   CTX_SHADOW_OFFSET_Y  = 143, // ky
 1731   CTX_IMAGE_SMOOTHING  = 144, // kS
 1732   CTX_LINE_DASH_OFFSET = 145, // kD lineDashOffset
 1733 
 1734 
 1735   CTX_EXTEND           = 146, // ke u32 extend mode, default=0
 1736   CTX_WRAP_LEFT        = 147, // kL
 1737   CTX_WRAP_RIGHT       = 148, // kR
 1738   CTX_LINE_HEIGHT      = 149, // kH
 1739                               //
 1740   CTX_STROKE_RECT      = 200, // strokeRect - only exist in long form
 1741   CTX_FILL_RECT        = 201, // fillRect   - only exist in long form
 1742 } CtxCode;
 1743 
 1744 
 1745 #pragma pack(push,1)
 1746 
 1747 
 1748 typedef struct _CtxCommand CtxCommand;
 1749 #define CTX_ASSERT               0
 1750 
 1751 #if CTX_ASSERT==1
 1752 #define ctx_assert(a)  if(!(a)){fprintf(stderr,"%s:%i assertion failed\n", 
 1753                    __FUNCTION__, __LINE__);  }
 1754 #else
 1755 #define ctx_assert(a)
 1756 #endif
 1757 
 1758 
 1759 struct
 1760   _CtxCommand
 1761 {
 1762   union
 1763   {
 1764     uint8_t  code;
 1765     CtxEntry entry;
 1766     struct
 1767     {
 1768       uint8_t code;
 1769       float scalex;
 1770       float scaley;
 1771     } scale;
 1772     struct
 1773     {
 1774       uint8_t code;
 1775       uint32_t stringlen;
 1776       uint32_t blocklen;
 1777       uint8_t cont;
 1778       uint8_t data[8]; /* ... and continues */
 1779     } data;
 1780     struct
 1781     {
 1782       uint8_t code;
 1783       uint32_t stringlen;
 1784       uint32_t blocklen;
 1785     } data_rev;
 1786     struct
 1787     {
 1788       uint8_t code;
 1789       uint32_t next_active_mask; // the tilehasher active flags for next
 1790                                  // drawing command
 1791       float pad2;
 1792       uint8_t code_data;
 1793       uint32_t stringlen;
 1794       uint32_t blocklen;
 1795       uint8_t code_cont;
 1796       uint8_t utf8[8]; /* .. and continues */
 1797     } text;
 1798     struct
 1799     {
 1800       uint8_t  code;
 1801       uint32_t key_hash;
 1802       float    pad;
 1803       uint8_t  code_data;
 1804       uint32_t stringlen;
 1805       uint32_t blocklen;
 1806       uint8_t  code_cont;
 1807       uint8_t  utf8[8]; /* .. and continues */
 1808     } set;
 1809     struct
 1810     {
 1811       uint8_t  code;
 1812       uint32_t pad0;
 1813       float    pad1;
 1814       uint8_t  code_data;
 1815       uint32_t stringlen;
 1816       uint32_t blocklen;
 1817       uint8_t  code_cont;
 1818       uint8_t  utf8[8]; /* .. and continues */
 1819     } get;
 1820     struct {
 1821       uint8_t  code;
 1822       uint32_t count; /* better than byte_len in code, but needs to then be 
 1823       set   */
 1824       float    pad1;
 1825       uint8_t  code_data;
 1826       uint32_t byte_len;
 1827       uint32_t blocklen;
 1828       uint8_t  code_cont;
 1829       float    data[2]; /* .. and - possibly continues */
 1830     } line_dash;
 1831     struct {
 1832       uint8_t  code;
 1833       uint32_t space_slot;
 1834       float    pad1;
 1835       uint8_t  code_data;
 1836       uint32_t data_len;
 1837       uint32_t blocklen;
 1838       uint8_t  code_cont;
 1839       uint8_t  data[8]; /* .. and continues */
 1840     } colorspace;
 1841     struct
 1842     {
 1843       uint8_t  code;
 1844       float    x;
 1845       float    y;
 1846       uint8_t  code_data;
 1847       uint32_t stringlen;
 1848       uint32_t blocklen;
 1849       uint8_t  code_cont;
 1850       char     eid[8]; /* .. and continues */
 1851     } texture;
 1852     struct
 1853     {
 1854       uint8_t  code;
 1855       uint32_t width;
 1856       uint32_t height;
 1857       uint8_t  code_cont0;
 1858       uint16_t format;
 1859       uint16_t pad0;
 1860       uint32_t pad1;
 1861       uint8_t  code_data;
 1862       uint32_t stringlen;
 1863       uint32_t blocklen;
 1864       uint8_t  code_cont1;
 1865       char     eid[8]; /* .. and continues */
 1866       // followed by - in variable offset code_Data, data_len, 
 1867       datablock_len, cont, pixeldata
 1868     } define_texture;
 1869     struct
 1870     {
 1871       uint8_t  code;
 1872       float    pad;
 1873       float    pad2;
 1874       uint8_t  code_data;
 1875       uint32_t stringlen;
 1876       uint32_t blocklen;
 1877       uint8_t  code_cont;
 1878       uint8_t  utf8[8]; /* .. and continues */
 1879     } text_stroke;
 1880     struct
 1881     {
 1882       uint8_t  code;
 1883       float    pad;
 1884       float    pad2;
 1885       uint8_t  code_data;
 1886       uint32_t stringlen;
 1887       uint32_t blocklen;
 1888       uint8_t  code_cont;
 1889       uint8_t  utf8[8]; /* .. and continues */
 1890     } set_font;
 1891     struct
 1892     {
 1893       uint8_t code;
 1894       float model;
 1895       float r;
 1896       uint8_t pad1;
 1897       float g;
 1898       float b;
 1899       uint8_t pad2;
 1900       float a;
 1901     } rgba;
 1902     struct
 1903     {
 1904       uint8_t code;
 1905       float model;
 1906       float c;
 1907       uint8_t pad1;
 1908       float m;
 1909       float y;
 1910       uint8_t pad2;
 1911       float k;
 1912       float a;
 1913     } cmyka;
 1914     struct
 1915     {
 1916       uint8_t code;
 1917       float model;
 1918       float g;
 1919       uint8_t pad1;
 1920       float a;
 1921     } graya;
 1922 
 1923     struct
 1924     {
 1925       uint8_t code;
 1926       float model;
 1927       float c0;
 1928       uint8_t pad1;
 1929       float c1;
 1930       float c2;
 1931       uint8_t pad2;
 1932       float c3;
 1933       float c4;
 1934       uint8_t pad3;
 1935       float c5;
 1936       float c6;
 1937       uint8_t pad4;
 1938       float c7;
 1939       float c8;
 1940       uint8_t pad5;
 1941       float c9;
 1942       float c10;
 1943     } set_color;
 1944     struct
 1945     {
 1946       uint8_t code;
 1947       float x;
 1948       float y;
 1949     } rel_move_to;
 1950     struct
 1951     {
 1952       uint8_t code;
 1953       float x;
 1954       float y;
 1955     } rel_line_to;
 1956     struct
 1957     {
 1958       uint8_t code;
 1959       float x;
 1960       float y;
 1961     } line_to;
 1962     struct
 1963     {
 1964       uint8_t code;
 1965       float cx1;
 1966       float cy1;
 1967       uint8_t pad0;
 1968       float cx2;
 1969       float cy2;
 1970       uint8_t pad1;
 1971       float x;
 1972       float y;
 1973     } rel_curve_to;
 1974     struct
 1975     {
 1976       uint8_t code;
 1977       float x;
 1978       float y;
 1979     } move_to;
 1980     struct
 1981     {
 1982       uint8_t code;
 1983       float cx1;
 1984       float cy1;
 1985       uint8_t pad0;
 1986       float cx2;
 1987       float cy2;
 1988       uint8_t pad1;
 1989       float x;
 1990       float y;
 1991     } curve_to;
 1992     struct
 1993     {
 1994       uint8_t code;
 1995       float x1;
 1996       float y1;
 1997       uint8_t pad0;
 1998       float r1;
 1999       float x2;
 2000       uint8_t pad1;
 2001       float y2;
 2002       float r2;
 2003     } radial_gradient;
 2004     struct
 2005     {
 2006       uint8_t code;
 2007       float x1;
 2008       float y1;
 2009       uint8_t pad0;
 2010       float x2;
 2011       float y2;
 2012     } linear_gradient;
 2013     struct
 2014     {
 2015       uint8_t code;
 2016       float x;
 2017       float y;
 2018       uint8_t pad0;
 2019       float width;
 2020       float height;
 2021       uint8_t pad1;
 2022       float radius;
 2023     } rectangle;
 2024     struct {
 2025       uint8_t code;
 2026       float x;
 2027       float y;
 2028       uint8_t pad0;
 2029       float width;
 2030       float height;
 2031     } view_box;
 2032 
 2033     struct
 2034     {
 2035       uint8_t code;
 2036       uint16_t glyph_before;
 2037       uint16_t glyph_after;
 2038        int32_t amount;
 2039     } kern;
 2040 
 2041     struct
 2042     {
 2043       uint8_t code;
 2044       uint32_t glyph;
 2045       uint32_t advance; // * 256
 2046     } define_glyph;
 2047 
 2048     struct
 2049     {
 2050       uint8_t code;
 2051       uint8_t rgba[4];
 2052       uint16_t x;
 2053       uint16_t y;
 2054     } set_pixel;
 2055     struct
 2056     {
 2057       uint8_t code;
 2058       float cx;
 2059       float cy;
 2060       uint8_t pad0;
 2061       float x;
 2062       float y;
 2063     } quad_to;
 2064     struct
 2065     {
 2066       uint8_t code;
 2067       float cx;
 2068       float cy;
 2069       uint8_t pad0;
 2070       float x;
 2071       float y;
 2072     } rel_quad_to;
 2073     struct
 2074     {
 2075       uint8_t code;
 2076       float x;
 2077       float y;
 2078       uint8_t pad0;
 2079       float radius;
 2080       float angle1;
 2081       uint8_t pad1;
 2082       float angle2;
 2083       float direction;
 2084     }
 2085     arc;
 2086     struct
 2087     {
 2088       uint8_t code;
 2089       float x1;
 2090       float y1;
 2091       uint8_t pad0;
 2092       float x2;
 2093       float y2;
 2094       uint8_t pad1;
 2095       float radius;
 2096     }
 2097     arc_to;
 2098     /* some format specific generic accesors:  */
 2099     struct
 2100     {
 2101       uint8_t code;
 2102       float   x0;
 2103       float   y0;
 2104       uint8_t pad0;
 2105       float   x1;
 2106       float   y1;
 2107       uint8_t pad1;
 2108       float   x2;
 2109       float   y2;
 2110       uint8_t pad2;
 2111       float   x3;
 2112       float   y3;
 2113       uint8_t pad3;
 2114       float   x4;
 2115       float   y4;
 2116     } c;
 2117     struct
 2118     {
 2119       uint8_t code;
 2120       float   a0;
 2121       float   a1;
 2122       uint8_t pad0;
 2123       float   a2;
 2124       float   a3;
 2125       uint8_t pad1;
 2126       float   a4;
 2127       float   a5;
 2128       uint8_t pad2;
 2129       float   a6;
 2130       float   a7;
 2131       uint8_t pad3;
 2132       float   a8;
 2133       float   a9;
 2134     } f;
 2135     struct
 2136     {
 2137       uint8_t  code;
 2138       uint32_t a0;
 2139       uint32_t a1;
 2140       uint8_t  pad0;
 2141       uint32_t a2;
 2142       uint32_t a3;
 2143       uint8_t  pad1;
 2144       uint32_t a4;
 2145       uint32_t a5;
 2146       uint8_t  pad2;
 2147       uint32_t a6;
 2148       uint32_t a7;
 2149       uint8_t  pad3;
 2150       uint32_t a8;
 2151       uint32_t a9;
 2152     } u32;
 2153     struct
 2154     {
 2155       uint8_t  code;
 2156       uint64_t a0;
 2157       uint8_t  pad0;
 2158       uint64_t a1;
 2159       uint8_t  pad1;
 2160       uint64_t a2;
 2161       uint8_t  pad2;
 2162       uint64_t a3;
 2163       uint8_t  pad3;
 2164       uint64_t a4;
 2165     } u64;
 2166     struct
 2167     {
 2168       uint8_t code;
 2169       int32_t a0;
 2170       int32_t a1;
 2171       uint8_t pad0;
 2172       int32_t a2;
 2173       int32_t a3;
 2174       uint8_t pad1;
 2175       int32_t a4;
 2176       int32_t a5;
 2177       uint8_t pad2;
 2178       int32_t a6;
 2179       int32_t a7;
 2180       uint8_t pad3;
 2181       int32_t a8;
 2182       int32_t a9;
 2183     } s32;
 2184     struct
 2185     {
 2186       uint8_t code;
 2187       int16_t a0;
 2188       int16_t a1;
 2189       int16_t a2;
 2190       int16_t a3;
 2191       uint8_t pad0;
 2192       int16_t a4;
 2193       int16_t a5;
 2194       int16_t a6;
 2195       int16_t a7;
 2196       uint8_t pad1;
 2197       int16_t a8;
 2198       int16_t a9;
 2199       int16_t a10;
 2200       int16_t a11;
 2201       uint8_t pad2;
 2202       int16_t a12;
 2203       int16_t a13;
 2204       int16_t a14;
 2205       int16_t a15;
 2206       uint8_t pad3;
 2207       int16_t a16;
 2208       int16_t a17;
 2209       int16_t a18;
 2210       int16_t a19;
 2211     } s16;
 2212     struct
 2213     {
 2214       uint8_t code;
 2215       uint16_t a0;
 2216       uint16_t a1;
 2217       uint16_t a2;
 2218       uint16_t a3;
 2219       uint8_t pad0;
 2220       uint16_t a4;
 2221       uint16_t a5;
 2222       uint16_t a6;
 2223       uint16_t a7;
 2224       uint8_t pad1;
 2225       uint16_t a8;
 2226       uint16_t a9;
 2227       uint16_t a10;
 2228       uint16_t a11;
 2229       uint8_t pad2;
 2230       uint16_t a12;
 2231       uint16_t a13;
 2232       uint16_t a14;
 2233       uint16_t a15;
 2234       uint8_t pad3;
 2235       uint16_t a16;
 2236       uint16_t a17;
 2237       uint16_t a18;
 2238       uint16_t a19;
 2239     } u16;
 2240     struct
 2241     {
 2242       uint8_t code;
 2243       uint8_t a0;
 2244       uint8_t a1;
 2245       uint8_t a2;
 2246       uint8_t a3;
 2247       uint8_t a4;
 2248       uint8_t a5;
 2249       uint8_t a6;
 2250       uint8_t a7;
 2251       uint8_t pad0;
 2252       uint8_t a8;
 2253       uint8_t a9;
 2254       uint8_t a10;
 2255       uint8_t a11;
 2256       uint8_t a12;
 2257       uint8_t a13;
 2258       uint8_t a14;
 2259       uint8_t a15;
 2260       uint8_t pad1;
 2261       uint8_t a16;
 2262       uint8_t a17;
 2263       uint8_t a18;
 2264       uint8_t a19;
 2265       uint8_t a20;
 2266       uint8_t a21;
 2267       uint8_t a22;
 2268       uint8_t a23;
 2269     } u8;
 2270     struct
 2271     {
 2272       uint8_t code;
 2273       int8_t a0;
 2274       int8_t a1;
 2275       int8_t a2;
 2276       int8_t a3;
 2277       int8_t a4;
 2278       int8_t a5;
 2279       int8_t a6;
 2280       int8_t a7;
 2281       uint8_t pad0;
 2282       int8_t a8;
 2283       int8_t a9;
 2284       int8_t a10;
 2285       int8_t a11;
 2286       int8_t a12;
 2287       int8_t a13;
 2288       int8_t a14;
 2289       int8_t a15;
 2290       uint8_t pad1;
 2291       int8_t a16;
 2292       int8_t a17;
 2293       int8_t a18;
 2294       int8_t a19;
 2295       int8_t a20;
 2296       int8_t a21;
 2297       int8_t a22;
 2298       int8_t a23;
 2299     } s8;
 2300   };
 2301   CtxEntry next_entry; // also pads size of CtxCommand slightly.
 2302 };
 2303 
 2304 typedef struct _CtxBackend CtxBackend;
 2305 void ctx_windowtitle (Ctx *ctx, const char *text);
 2306 struct _CtxBackend
 2307 {
 2308   Ctx                      *ctx;
 2309   void  (*process)         (Ctx *ctx, CtxCommand *entry);
 2310   void  (*start_frame)     (Ctx *ctx);
 2311   void  (*end_frame)       (Ctx *ctx);
 2312 
 2313   void  (*set_windowtitle) (Ctx *ctx, const char *text);
 2314 
 2315   char *(*get_event)       (Ctx *ctx, int timout_ms);
 2316 
 2317   void  (*consume_events)  (Ctx *ctx);
 2318   void  (*get_event_fds)   (Ctx *ctx, int *fd, int *count);
 2319   char *(*get_clipboard)   (Ctx *ctx);
 2320   void  (*set_clipboard)   (Ctx *ctx, const char *text);
 2321   void  (*destroy)         (void *backend); /* the free pointers are abused 
 2322          as the differentiatior
 2323                                                between different backends   
 2324                                                */
 2325   CtxFlags                  flags;
 2326   void                     *user_data; // not used by ctx core
 2327 };
 2328 
 2329 typedef struct _CtxIterator CtxIterator;
 2330 
 2331 void
 2332 ctx_logo (Ctx *ctx, float x, float y, float dim);
 2333 
 2334 /* to be freed with ctx_free */
 2335 CtxDrawlist *
 2336 ctx_current_path (Ctx *ctx);
 2337 
 2338 void
 2339 ctx_path_extents (Ctx *ctx, float *ex1, float *ey1, float *ex2, float *ey2);
 2340 CtxCommand *ctx_iterator_next (CtxIterator *iterator);
 2341 void
 2342 ctx_iterator_init (CtxIterator  *iterator,
 2343                    CtxDrawlist  *drawlist,  // replace with Ctx*  ?
 2344                    int           start_pos,
 2345                    int           flags);    // need exposing for font bits
 2346 int ctx_iterator_pos (CtxIterator *iterator);
 2347 
 2348 void ctx_handle_events (Ctx *ctx);
 2349 #define ctx_arg_string()  ((char*)&entry[2].data.u8[0])
 2350 
 2351 
 2352 /* The above should be public API
 2353  */
 2354 
 2355 #pragma pack(pop)
 2356 
 2357 /* access macros for nth argument of a given type when packed into
 2358  * an CtxEntry pointer in current code context
 2359  */
 2360 #define ctx_arg_float(no) entry[(no)>>1].data.f[(no)&1]
 2361 #define ctx_arg_u64(no)   entry[(no)].data.u64[0]
 2362 #define ctx_arg_u32(no)   entry[(no)>>1].data.u32[(no)&1]
 2363 #define ctx_arg_s32(no)   entry[(no)>>1].data.s32[(no)&1]
 2364 #define ctx_arg_u16(no)   entry[(no)>>2].data.u16[(no)&3]
 2365 #define ctx_arg_s16(no)   entry[(no)>>2].data.s16[(no)&3]
 2366 #define ctx_arg_u8(no)    entry[(no)>>3].data.u8[(no)&7]
 2367 #define ctx_arg_s8(no)    entry[(no)>>3].data.s8[(no)&7]
 2368 #define ctx_arg_string()  ((char*)&entry[2].data.u8[0])
 2369 
 2370 typedef enum
 2371 {
 2372   CTX_GRAY           = 1,
 2373   CTX_RGB            = 3,
 2374   CTX_DRGB           = 4,
 2375   CTX_CMYK           = 5,
 2376   CTX_DCMYK          = 6,
 2377   CTX_LAB            = 7,
 2378   CTX_LCH            = 8,
 2379   CTX_GRAYA          = 101,
 2380   CTX_RGBA           = 103,
 2381   CTX_DRGBA          = 104,
 2382   CTX_CMYKA          = 105,
 2383   CTX_DCMYKA         = 106,
 2384   CTX_LABA           = 107,
 2385   CTX_LCHA           = 108,
 2386   CTX_GRAYA_A        = 201,
 2387   CTX_RGBA_A         = 203,
 2388   CTX_RGBA_A_DEVICE  = 204,
 2389   CTX_CMYKA_A        = 205,
 2390   CTX_DCMYKA_A       = 206,
 2391   // RGB  device and  RGB  ?
 2392 } CtxColorModel;
 2393 
 2394 
 2395 enum _CtxCursor
 2396 {
 2397   CTX_CURSOR_UNSET,
 2398   CTX_CURSOR_NONE,
 2399   CTX_CURSOR_ARROW,
 2400   CTX_CURSOR_IBEAM,
 2401   CTX_CURSOR_WAIT,
 2402   CTX_CURSOR_HAND,
 2403   CTX_CURSOR_CROSSHAIR,
 2404   CTX_CURSOR_RESIZE_ALL,
 2405   CTX_CURSOR_RESIZE_N,
 2406   CTX_CURSOR_RESIZE_S,
 2407   CTX_CURSOR_RESIZE_E,
 2408   CTX_CURSOR_RESIZE_NE,
 2409   CTX_CURSOR_RESIZE_SE,
 2410   CTX_CURSOR_RESIZE_W,
 2411   CTX_CURSOR_RESIZE_NW,
 2412   CTX_CURSOR_RESIZE_SW,
 2413   CTX_CURSOR_MOVE
 2414 };
 2415 typedef enum _CtxCursor CtxCursor;
 2416 
 2417 /* to be used immediately after a ctx_listen or ctx_listen_full causing the
 2418  * cursor to change when hovering the listen area.
 2419  */
 2420 void ctx_listen_set_cursor (Ctx      *ctx,
 2421                             CtxCursor cursor);
 2422 
 2423 /* lower level cursor setting that is independent of ctx event handling
 2424  */
 2425 void         ctx_set_cursor (Ctx *ctx, CtxCursor cursor);
 2426 CtxCursor    ctx_get_cursor (Ctx *ctx);
 2427 void         ctx_set_render_threads   (Ctx *ctx, int n_threads);
 2428 int          ctx_get_render_threads   (Ctx *ctx);
 2429 
 2430 void         ctx_set_hash_cache (Ctx *ctx, int enable_hash_cache);
 2431 int          ctx_get_hash_cache (Ctx *ctx);
 2432 
 2433 
 2434 typedef struct _CtxParser CtxParser;
 2435   CtxParser *ctx_parser_new (
 2436   Ctx       *ctx,
 2437   int        width,
 2438   int        height,
 2439   float      cell_width,
 2440   float      cell_height,
 2441   int        cursor_x,
 2442   int        cursor_y,
 2443   int   (*set_prop)(void *prop_data, uint32_t key, const char *data,  int 
 2444          len),
 2445   int   (*get_prop)(void *prop_Data, const char *key, char **data, int *len)
 2446          ,
 2447   void  *prop_data,
 2448   void (*exit) (void *exit_data),
 2449   void *exit_data);
 2450 
 2451 
 2452 enum _CtxColorSpace
 2453 {
 2454   CTX_COLOR_SPACE_DEVICE_RGB,
 2455   CTX_COLOR_SPACE_DEVICE_CMYK,
 2456   CTX_COLOR_SPACE_USER_RGB,
 2457   CTX_COLOR_SPACE_USER_CMYK,
 2458   CTX_COLOR_SPACE_TEXTURE
 2459 };
 2460 typedef enum _CtxColorSpace CtxColorSpace;
 2461 
 2462 
 2463 /* sets the color space for a slot, the space is either a string of
 2464  * "sRGB" "rec2020" .. etc or an icc profile.
 2465  *
 2466  * The slots device_rgb and device_cmyk is mostly to be handled outside 
 2467  drawing 
 2468  * code, and user_rgb and user_cmyk is to be used. With no user_cmyk set
 2469  * user_cmyk == device_cmyk.
 2470  *
 2471  * The set profiles follows the graphics state.
 2472  */
 2473 void ctx_colorspace (Ctx           *ctx,
 2474                      CtxColorSpace  space_slot,
 2475                      unsigned char *data,
 2476                      int            data_length);
 2477 
 2478 
 2479 
 2480 
 2481 void
 2482 ctx_parser_set_size (CtxParser *parser,
 2483                      int        width,
 2484                      int        height,
 2485                      float      cell_width,
 2486                      float      cell_height);
 2487 
 2488 void ctx_parser_feed_bytes (CtxParser *parser, const char *data, int count);
 2489 
 2490 int
 2491 ctx_get_contents (const char     *path,
 2492                    unsigned char **contents,
 2493                    long           *length);
 2494 int
 2495 ctx_get_contents2 (const char     *path,
 2496                    unsigned char **contents,
 2497                    long           *length,
 2498                    long            max_len);
 2499 
 2500 void ctx_parser_destroy (CtxParser *parser);
 2501 typedef struct _CtxSHA1 CtxSHA1;
 2502 
 2503 void
 2504 ctx_bin2base64 (const void *bin,
 2505                 size_t      bin_length,
 2506                 char       *ascii);
 2507 int
 2508 ctx_base642bin (const char    *ascii,
 2509                 int           *length,
 2510                 unsigned char *bin);
 2511 
 2512 
 2513 struct
 2514   _CtxMatrix
 2515 {
 2516   float m[3][3];
 2517 };
 2518 
 2519 void ctx_apply_matrix (Ctx *ctx, CtxMatrix *matrix);
 2520 void ctx_matrix_apply_transform (const CtxMatrix *m, float *x, float *y);
 2521 void ctx_matrix_apply_transform_distance (const CtxMatrix *m, float *x, 
 2522                                           float *y);
 2523 void ctx_matrix_invert (CtxMatrix *m);
 2524 void ctx_matrix_identity (CtxMatrix *matrix);
 2525 void ctx_matrix_scale (CtxMatrix *matrix, float x, float y);
 2526 void ctx_matrix_rotate (CtxMatrix *matrix, float angle);
 2527 void ctx_matrix_translate (CtxMatrix *matrix, float x, float y);
 2528 void ctx_matrix_multiply (CtxMatrix       *result,
 2529                           const CtxMatrix *t,
 2530                           const CtxMatrix *s);
 2531 
 2532 
 2533 /* we already have the start of the file available which disambiguates some
 2534  * of our important supported formats, give preference to magic, then 
 2535  extension
 2536  * then text plain vs binary.
 2537  */
 2538 const char *ctx_guess_media_type (const char *path, const char *content, 
 2539                                   int len);
 2540 
 2541 /* get media-type, with preference towards using extension of path and
 2542  * not reading the data at all.
 2543  */
 2544 const char *ctx_path_get_media_type (const char *path);
 2545 
 2546 typedef enum {
 2547   CTX_MEDIA_TYPE_NONE=0,
 2548   CTX_MEDIA_TYPE_TEXT,
 2549   CTX_MEDIA_TYPE_IMAGE,
 2550   CTX_MEDIA_TYPE_VIDEO,
 2551   CTX_MEDIA_TYPE_AUDIO,
 2552   CTX_MEDIA_TYPE_INODE,
 2553   CTX_MEDIA_TYPE_APPLICATION,
 2554 } CtxMediaTypeClass;
 2555 
 2556 int ctx_media_type_is_text (const char *media_type);
 2557 CtxMediaTypeClass ctx_media_type_class (const char *media_type);
 2558 
 2559 
 2560 float ctx_term_get_cell_width (Ctx *ctx);
 2561 float ctx_term_get_cell_height (Ctx *ctx);
 2562 
 2563 Ctx * ctx_new_pdf (const char *path, float width, float height);
 2564 void ctx_render_pdf (Ctx *ctx, const char *path);
 2565 
 2566 #ifndef CTX_CODEC_CHAR
 2567 //#define CTX_CODEC_CHAR '\035'
 2568 //#define CTX_CODEC_CHAR 'a'
 2569 #define CTX_CODEC_CHAR '\020' // datalink escape
 2570 //#define CTX_CODEC_CHAR '^'
 2571 #endif
 2572 
 2573 #ifndef assert
 2574 #define assert(a)
 2575 #endif
 2576 
 2577 #ifdef __cplusplus
 2578 }
 2579 #endif
 2580 #endif
 2581 #ifndef __CTX_H__
 2582 #define __CTX_H__
 2583 #ifndef _DEFAULT_SOURCE
 2584 #define _DEFAULT_SOURCE
 2585 #endif
 2586 #ifndef _XOPEN_SOURCE
 2587 #define _XOPEN_SOURCE 600
 2588 #endif
 2589 
 2590 #ifndef CTX_STRING_H
 2591 #define CTX_STRING_H
 2592 
 2593 typedef struct _CtxString CtxString;
 2594 struct _CtxString
 2595 {
 2596   char *str;
 2597   int   length;
 2598   int   utf8_length;
 2599   int   allocated_length;
 2600   int   is_line;
 2601 };
 2602 
 2603 CtxString   *ctx_string_new_with_size  (const char *initial, int 
 2604                                         initial_size);
 2605 CtxString   *ctx_string_new            (const char *initial);
 2606 CtxString   *ctx_string_new_printf (const char *format, ...);
 2607 char       *ctx_string_dissolve       (CtxString *string);
 2608 void        ctx_string_free           (CtxString *string, int freealloc);
 2609 const char *ctx_string_get            (CtxString *string);
 2610 uint32_t    ctx_string_get_unichar    (CtxString *string, int pos);
 2611 int         ctx_string_get_length     (CtxString *string);
 2612 int         ctx_string_get_utf8length (CtxString *string);
 2613 void        ctx_string_set            (CtxString *string, const char 
 2614                                        *new_string);
 2615 void        ctx_string_clear          (CtxString *string);
 2616 void        ctx_string_append_str     (CtxString *string, const char *str);
 2617 void        ctx_string_append_byte    (CtxString *string, char  val);
 2618 void        ctx_string_append_string  (CtxString *string, CtxString 
 2619                                        *string2);
 2620 void        ctx_string_append_unichar (CtxString *string, unsigned int 
 2621                                        unichar);
 2622 void        ctx_string_append_data    (CtxString *string, const char *data, 
 2623                                        int len);
 2624 
 2625 void        ctx_string_pre_alloc       (CtxString *string, int size);
 2626 void        ctx_string_append_utf8char (CtxString *string, const char *str);
 2627 void        ctx_string_append_printf  (CtxString *string, const char 
 2628                                        *format, ...);
 2629 void        ctx_string_replace_utf8   (CtxString *string, int pos, const 
 2630                                        char *new_glyph);
 2631 void        ctx_string_insert_utf8    (CtxString *string, int pos, const 
 2632                                        char *new_glyph);
 2633 
 2634 void        ctx_string_insert_unichar (CtxString *string, int pos, uint32_t 
 2635                                        unichar);
 2636 void        ctx_string_replace_unichar (CtxString *string, int pos, 
 2637                                         uint32_t unichar);
 2638 void        ctx_string_remove         (CtxString *string, int pos);
 2639 char       *ctx_strdup_printf         (const char *format, ...);
 2640 void        ctx_string_append_int     (CtxString *string, int val);
 2641 void        ctx_string_append_float   (CtxString *string, float val);
 2642 
 2643 #ifndef TRUE
 2644 #define TRUE 1
 2645 #endif
 2646 #ifndef FALSE
 2647 #define FALSE 0
 2648 #endif
 2649 
 2650 #endif
 2651 #ifndef _CTX_INTERNAL_FONT_
 2652 #define _CTX_INTERNAL_FONT_
 2653 
 2654 #ifndef CTX_FONT_ascii
 2655 /* glyph index: 
 2656  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghi
 2657   jklmnopqrstuvwxyz{|}~  */
 2658 static const struct __attribute__ ((packed)) {uint8_t code; uint32_t a; 
 2659                                    uint32_t b;}
 2660 ctx_font_ascii[]={
 2661 {15, 0x0000a008, 0x000007a7},/* length:1959 CTX_SUBDIV:8 CTX_BAKE_FONT_SIZE:
 2662  160 */
 2663 {'(', 0x00000008, 0x00000001},/* Roboto*/
 2664 {32, 0x6f626f52, 0x00006f74},
 2665 {')', 0x00000008, 0x00000001},
 2666 {'(', 0x0000004b, 0x00000009},/* Apache Licence, Version 2.0
 2667                                 Copyright 2014 Christian Robertson - Apache 
 2668                                 2*/
 2669 {32, 0x63617041, 0x4c206568},
 2670 {'i', 0x636e6563, 0x56202c65},
 2671 {'e', 0x6f697372, 0x2e32206e},
 2672 {'0', 0x706f430a, 0x67697279},
 2673 {'h', 0x30322074, 0x43203431},
 2674 {'h', 0x74736972, 0x206e6169},
 2675 {'R', 0x7265626f, 0x6e6f7374},
 2676 {32, 0x7041202d, 0x65686361},
 2677 {32, 0x00000032, 0x00000000},
 2678 {')', 0x0000004b, 0x00000009},
 2679 {'@', 0x00000020, 0x000021dd},/*                 x-advance: 33.863281 */
 2680 {'@', 0x00000021, 0x00002333},/*        !        x-advance: 35.199219 */
 2681 {'M', 0x41c08889, 0xc2c22223},
 2682 {'l', 0xbf5ddde0, 0x428b5556},
 2683 {'4', 0x0000ffa7, 0xfdd3fff9},
 2684 {'6', 0x00000067, 0x02d6ff96},
 2685 {'8', 0xd80ee800, 0xf02bf00e},
 2686 {'8', 0x102b001c, 0x280f100f},
 2687 {'8', 0x27f11600, 0x10d510f2},
 2688 {'8', 0xf0d500e4, 0xd9f2f0f2},
 2689 {'@', 0x00000022, 0x00002bbb},/*        "        x-advance: 43.730469 */
 2690 {'M', 0x41944445, 0xc2baaaab},
 2691 {'l', 0xc0000000, 0x41be6664},
 2692 {'l', 0xc0ecccce, 0x00000000},
 2693 {'4', 0xfefa0000, 0x0000004b},
 2694 {'6', 0x00480000, 0x00000090},
 2695 {'l', 0xc0000000, 0x41be6664},
 2696 {'l', 0xc0ecccd0, 0x00000000},
 2697 {'l', 0x00000000, 0xc2037778},
 2698 {'l', 0x41166668, 0x00000000},
 2699 {'l', 0x00000000, 0x41111118},
 2700 {'[', 0x00770022, 0x000000bb},/*kerning*/
 2701 {'@', 0x00000023, 0x00005411},/*        #        x-advance: 84.066406 */
 2702 {'M', 0x4236eef0, 0x00000000},
 2703 {'l', 0x40aaaaa8, 0xc1daaaab},
 2704 {'l', 0xc18cccce, 0x00000000},
 2705 {'l', 0xc0aaaaa8, 0x41daaaab},
 2706 {'l', 0xc118888a, 0x00000000},
 2707 {'l', 0x40aaaaac, 0xc1daaaab},
 2708 {'l', 0xc1800000, 0x00000000},
 2709 {'l', 0xb5000000, 0xc1133336},
 2710 {'l', 0x418e6667, 0x00000000},
 2711 {'l', 0x40911110, 0xc1bc4444},
 2712 {'l', 0xc18a2222, 0x00000000},
 2713 {'l', 0xb5800000, 0xc1144444},
 2714 {'l', 0x4198888a, 0x00000000},
 2715 {'l', 0x40acccc8, 0xc1dddde0},
 2716 {'l', 0x4119999c, 0x00000000},
 2717 {'l', 0xc0acccd0, 0x41dddde0},
 2718 {'l', 0x418cccce, 0x00000000},
 2719 {'l', 0x40acccd0, 0xc1dddde0},
 2720 {'l', 0x41188888, 0x00000000},
 2721 {'l', 0xc0acccd0, 0x41dddde0},
 2722 {'l', 0x41588888, 0x00000000},
 2723 {'l', 0x00000000, 0x41144444},
 2724 {'l', 0xc1755558, 0x00000000},
 2725 {'l', 0xc0933330, 0x41bc4444},
 2726 {'l', 0x416eeef0, 0x00000000},
 2727 {'l', 0x00000000, 0x41133336},
 2728 {'4', 0x0000ff7b, 0x00daffd6},
 2729 {'6', 0x0000ffb4, 0xfedcffad},
 2730 {'l', 0x418ccccc, 0x00000000},
 2731 {'l', 0x40933338, 0xc1bc4444},
 2732 {'l', 0xc18cccce, 0x00000000},
 2733 {'l', 0xc0933330, 0x41bc4444},
 2734 {'@', 0x00000024, 0x00004cbb},/*        $        x-advance: 76.730469 */
 2735 {'M', 0x428aeeef, 0xc1c91112},
 2736 {'q', 0x00000000, 0x4139999b},
 2737 {0, 0xc0dffff8, 0x4192aaac},
 2738 {'9', 0x0035ffc9, 0x003fff6b},
 2739 {'4', 0x00650000, 0x0000ffb1},
 2740 {'l', 0x00000000, 0xc14aaaac},
 2741 {'q', 0xc1244446, 0xbf888887},
 2742 {0, 0xc1933334, 0xc0f9999a},
 2743 {'9', 0xffcaffc0, 0xff50ffc0},
 2744 {'l', 0x41466666, 0x00000000},
 2745 {'q', 0x00000000, 0x41344446},
 2746 {0, 0x40c00004, 0x41744446},
 2747 {'8', 0x1f641f30, 0xdf6e0047},
 2748 {'8', 0xa527de27, 0xadddd000},
 2749 {'q', 0xc08aaaa8, 0xc08cccd0},
 2750 {0, 0xc1700000, 0xc0f99998},
 2751 {'q', 0xc149999a, 0xc0800000},
 2752 {0, 0xc19ccccd, 0xc129999c},
 2753 {'q', 0xc0e00000, 0xc0d33330},
 2754 {0, 0xc0e00000, 0xc1919998},
 2755 {'q', 0x00000000, 0xc1311118},
 2756 {0, 0x40cccccc, 0xc18f7778},
 2757 {'9', 0xffc90033, 0xffbe008b},
 2758 {'4', 0xff8c0000, 0x00000050},
 2759 {'l', 0x00000000, 0x416aaaa8},
 2760 {'q', 0x41333334, 0x3fbbbbc0},
 2761 {0, 0x418b3334, 0x41166668},
 2762 {'9', 0x003e0032, 0x00ac0032},
 2763 {'l', 0xc1444448, 0x00000000},
 2764 {'q', 0x00000000, 0xc10eeef0},
 2765 {0, 0xc0888888, 0xc16aaaa8},
 2766 {'8', 0xd29ed2de, 0x229d00bd},
 2767 {'8', 0x59e122e1, 0x531f3200},
 2768 {'q', 0x407bbbc0, 0x40822220},
 2769 {0, 0x41844444, 0x41055554},
 2770 {'q', 0x414aaaac, 0x40888890},
 2771 {0, 0x4198888a, 0x412aaaac},
 2772 {'q', 0x40ceeee8, 0x40caaab0},
 2773 {0, 0x40ceeee8, 0x418d5556},
 2774 {'@', 0x00000025, 0x00006400},/*        %        x-advance: 100.000000 */
 2775 {'M', 0x40e00001, 0xc29ccccd},
 2776 {'q', 0x00000000, 0xc1044448},
 2777 {0, 0x40aaaaab, 0xc1622228},
 2778 {'q', 0x40aaaaac, 0xc0bddde0},
 2779 {0, 0x4168888a, 0xc0bddde0},
 2780 {'q', 0x41155554, 0x00000000},
 2781 {0, 0x41699998, 0x40bddde0},
 2782 {'9', 0x002e002a, 0x0071002a},
 2783 {'l', 0x00000000, 0x40a44440},
 2784 {'q', 0x00000000, 0x41022220},
 2785 {0, 0xc0a88888, 0x41611110},
 2786 {'q', 0xc0a88888, 0x40bbbbc0},
 2787 {0, 0xc168888a, 0x40bbbbc0},
 2788 {'q', 0xc1144446, 0x00000000},
 2789 {0, 0xc16aaaac, 0xc0bbbbc0},
 2790 {'9', 0xffd1ffd6, 0xff90ffd6},
 2791 {'6', 0xffd70000, 0x0029004a},
 2792 {'8', 0x42142400, 0x1d411d15},
 2793 {'8', 0xe43f002a, 0xbe14e314},
 2794 {'l', 0x00000000, 0xc0a44440},
 2795 {'8', 0xbeebdb00, 0xe3c0e3ec},
 2796 {'8', 0x1dc000d6, 0x42ec1dec},
 2797 {'6', 0x00290000, 0xffb001e7},
 2798 {'l', 0xc23d999a, 0x4297bbbc},
 2799 {'4', 0xffddffc9, 0xfda2017b},
 2800 {'6', 0x00230037, 0x01dbff49},
 2801 {'q', 0x00000000, 0xc1033330},
 2802 {0, 0x40aaaaa8, 0xc1611110},
 2803 {'q', 0x40aaaaa8, 0xc0bddde0},
 2804 {0, 0x4168888c, 0xc0bddde0},
 2805 {'q', 0x41155558, 0x00000000},
 2806 {0, 0x41699998, 0x40bddde0},
 2807 {'9', 0x002e002a, 0x0070002a},
 2808 {'l', 0x00000000, 0x40a66668},
 2809 {'q', 0x00000000, 0x41033333},
 2810 {0, 0xc0a88890, 0x41622222},
 2811 {'q', 0xc0a88880, 0x40bbbbbd},
 2812 {0, 0xc1688888, 0x40bbbbbd},
 2813 {'q', 0xc1155558, 0x00000000},
 2814 {0, 0xc16aaaac, 0xc0bbbbbc},
 2815 {'9', 0xffd1ffd6, 0xff8fffd6},
 2816 {'6', 0xffd70000, 0x0029004a},
 2817 {'8', 0x42142500, 0x1d411d15},
 2818 {'8', 0xe440002b, 0xbd14e314},
 2819 {'l', 0x00000000, 0xc0a66668},
 2820 {'8', 0xbeebdb00, 0xe3c0e3ec},
 2821 {'8', 0x1dc000d6, 0x42ec1cec},
 2822 {'l', 0x00000000, 0x40a66668},
 2823 {'@', 0x00000026, 0x000054ee},/*        &        x-advance: 84.929688 */
 2824 {'M', 0x428b5556, 0x00000000},
 2825 {'l', 0xc0ccccd0, 0xc0f55556},
 2826 {'8', 0x35a323d8, 0x129512cb},
 2827 {'q', 0xc168888a, 0xb4000000},
 2828 {0, 0xc1b77778, 0xc0f77779},
 2829 {'q', 0xc1066667, 0xc0f77778},
 2830 {0, 0xc1066667, 0xc19dddde},
 2831 {'q', 0x00000000, 0xc10aaaac},
 2832 {0, 0x40a66668, 0xc1699998},
 2833 {'8', 0xa26cd02a, 0xa6c0d0d8},
 2834 {'q', 0xc03bbbbc, 0xc0a88890},
 2835 {0, 0xc03bbbbc, 0xc1300000},
 2836 {'q', 0x00000000, 0xc1355558},
 2837 {0, 0x40d55556, 0xc18b3334},
 2838 {'q', 0x40d55558, 0xc0c44440},
 2839 {0, 0x418d5557, 0xc0c44440},
 2840 {'q', 0x412bbbbc, 0x00000000},
 2841 {0, 0x4186eeee, 0x40c44440},
 2842 {'q', 0x40c66668, 0x40c22220},
 2843 {0, 0x40c66668, 0x41655558},
 2844 {'8', 0x5ee43800, 0x4ab426e4},
 2845 {'4', 0x002bffc6, 0x00ce00ac},
 2846 {'9', 0xffbb0024, 0xff660024},
 2847 {'l', 0x41311110, 0x00000000},
 2848 {'9', 0x00880000, 0x00e1ffbf},
 2849 {'4', 0x0084006e, 0x0000ff8a},
 2850 {'m', 0xc22a6668, 0xc2968889},
 2851 {'9', 0x00310000, 0x0080003e},
 2852 {'l', 0x40e44448, 0xc0a22220},
 2853 {'8', 0xd233e823, 0xc311ea11},
 2854 {'8', 0xc7e8e100, 0xe6bbe6e8},
 2855 {'8', 0x1fba00d2, 0x49e81ee8},
 2856 {'m', 0xc0fddddc, 0x42448889},
 2857 {'q', 0x00000000, 0x40e22224},
 2858 {0, 0x40955554, 0x41433334},
 2859 {'q', 0x40955558, 0x40a44446},
 2860 {0, 0x41655556, 0x40a44446},
 2861 {'9', 0x0000004e, 0xffc5008f},
 2862 {'4', 0xff1eff43, 0x0010ffea},
 2863 {'8', 0x4dba2ac7, 0x34f423f4},
 2864 {'@', 0x00000027, 0x000017dd},/*        '        x-advance: 23.863281 */
 2865 {'M', 0x41877778, 0xc2ccccce},
 2866 {'l', 0x00000000, 0x40eaaab0},
 2867 {'l', 0xbfb33338, 0x41c44444},
 2868 {'l', 0xc109999a, 0x00000000},
 2869 {'l', 0x3d8888c0, 0xc1feeef0},
 2870 {'l', 0x411eeef0, 0x00000000},
 2871 {'[', 0x00770027, 0x000000bb},/*kerning*/
 2872 {'@', 0x00000028, 0x00002ebb},/*        (        x-advance: 46.730469 */
 2873 {'M', 0x410eeeef, 0xc21dddde},
 2874 {'q', 0x00000000, 0xc19aaaac},
 2875 {0, 0x40b11112, 0xc2073334},
 2876 {'q', 0x40b11114, 0xc1677778},
 2877 {0, 0x41522224, 0xc1bccccc},
 2878 {'9', 0xffb7003c, 0xff9b006f},
 2879 {'l', 0x40266660, 0x41022228},
 2880 {'q', 0xc0fbbbb8, 0x40bdddd0},
 2881 {0, 0xc1766666, 0x41a99998},
 2882 {'q', 0xc0eeeef0, 0x41733338},
 2883 {0, 0xc0eeeef0, 0x42262223},
 2884 {'q', 0x00000000, 0x41caaaab},
 2885 {0, 0x40eeeef0, 0x4222eeef},
 2886 {'9', 0x007b003c, 0x00ae007b},
 2887 {'l', 0xc0266660, 0x40eeeef0},
 2888 {'q', 0xc0caaab0, 0xc05ddde0},
 2889 {0, 0xc15eeef0, 0xc149999c},
 2890 {'q', 0xc0f33334, 0xc1122222},
 2891 {0, 0xc1522224, 0xc1bc4444},
 2892 {'q', 0xc0b11112, 0xc167777a},
 2893 {0, 0xc0b11112, 0xc20aaaab},
 2894 {'[', 0x00560028, 0x00000155},/*kerning*/
 2895 {'[', 0x00570028, 0x00000133},/*kerning*/
 2896 {'[', 0x00590028, 0x00000177},/*kerning*/
 2897 {'@', 0x00000029, 0x00002f88},/*        )        x-advance: 47.531250 */
 2898 {'M', 0x42173334, 0xc21b3334},
 2899 {'q', 0x00000000, 0x419bbbbd},
 2900 {0, 0xc0b11110, 0x4207bbbc},
 2901 {'q', 0xc0b11114, 0x4167777a},
 2902 {0, 0xc1533336, 0x41bcccce},
 2903 {'9', 0x0049ffc4, 0x0064ff92},
 2904 {'l', 0xc0266669, 0xc0eeeef0},
 2905 {'q', 0x40f9999a, 0xc0bddde0},
 2906 {0, 0x41755556, 0xc1ac4445},
 2907 {'q', 0x40f11110, 0xc179999b},
 2908 {0, 0x40f11110, 0xc227bbbc},
 2909 {'q', 0x00000000, 0xc186eef2},
 2910 {0, 0xc06eeef0, 0xc1eb3334},
 2911 {'q', 0xc06eeef0, 0xc14999a0},
 2912 {0, 0xc1111111, 0xc1a6eef0},
 2913 {'9', 0xffbeffd6, 0xff9fffb0},
 2914 {'l', 0x40266666, 0xc0f11110},
 2915 {'q', 0x40c88889, 0x40622220},
 2916 {0, 0x415dddde, 0x414aaab0},
 2917 {'q', 0x40f55558, 0x41122220},
 2918 {0, 0x41533336, 0x41bccccc},
 2919 {'q', 0x40b11110, 0x41666668},
 2920 {0, 0x40b11110, 0x4209ddde},
 2921 {'@', 0x0000002a, 0x00003acc},/*        *        x-advance: 58.796875 */
 2922 {'M', 0x4109999a, 0xc23ccccd},
 2923 {'l', 0x41566668, 0xc1933336},
 2924 {'l', 0xc1a11112, 0xc0c00000},
 2925 {'l', 0x4048888a, 0xc1200000},
 2926 {'l', 0x41a11112, 0x40ecccd0},
 2927 {'l', 0xbf1999a0, 0xc1b77778},
 2928 {'l', 0x41222222, 0x00000000},
 2929 {'l', 0xbf2aaac0, 0x41baaaac},
 2930 {'l', 0x419eeef0, 0xc0ecccd0},
 2931 {'l', 0x40444450, 0x41233338},
 2932 {'l', 0xc1a3bbbe, 0x40c22220},
 2933 {'l', 0x41522224, 0x41908888},
 2934 {'l', 0xc1044444, 0x40c66668},
 2935 {'l', 0xc1455556, 0xc199999a},
 2936 {'l', 0xc1411112, 0x4195ddde},
 2937 {'l', 0xc1055556, 0xc0c22220},
 2938 {'@', 0x0000002b, 0x00004d77},/*        +        x-advance: 77.464844 */
 2939 {'M', 0x428f7778, 0xc221ddde},
 2940 {'l', 0xc1d8888a, 0x00000000},
 2941 {'l', 0x00000000, 0x41f5ddde},
 2942 {'l', 0xc1455554, 0x00000000},
 2943 {'l', 0x00000000, 0xc1f5ddde},
 2944 {'l', 0xc1d91112, 0x00000000},
 2945 {'l', 0xb5000000, 0xc139999c},
 2946 {'l', 0x41d91112, 0x00000000},
 2947 {'l', 0x00000000, 0xc1e2aaaa},
 2948 {'l', 0x41455554, 0x00000000},
 2949 {'l', 0x00000000, 0x41e2aaaa},
 2950 {'l', 0x41d8888a, 0x00000000},
 2951 {'l', 0x00000000, 0x4139999c},
 2952 {'@', 0x0000002c, 0x00001add},/*        ,        x-advance: 26.863281 */
 2953 {'M', 0x41a4cccd, 0xc16aaaab},
 2954 {'l', 0x00000000, 0x411eeeef},
 2955 {'8', 0x66e83000, 0x5abc35e8},
 2956 {'l', 0xc0e00000, 0xc09bbbbe},
 2957 {'9', 0xffb90033, 0xff6e0034},
 2958 {'l', 0x00000000, 0xc12eeef0},
 2959 {'l', 0x41411111, 0x00000000},
 2960 {'@', 0x0000002d, 0x000025bb},/*        -        x-advance: 37.730469 */
 2961 {'M', 0x420c4445, 0xc2395556},
 2962 {'l', 0x00000000, 0x41222224},
 2963 {'l', 0xc2022223, 0x00000000},
 2964 {'l', 0x35400000, 0xc1222224},
 2965 {'l', 0x42022223, 0x00000000},
 2966 {'@', 0x0000002e, 0x00002400},/*        .        x-advance: 36.000000 */
 2967 {'M', 0x4119999a, 0xc0d11112},
 2968 {'8', 0xd60fe700, 0xef2def10},
 2969 {'8', 0x112d001d, 0x2a101110},
 2970 {'8', 0x29f01800, 0x11d311f1},
 2971 {'8', 0xefd300e3, 0xd7f1eff1},
 2972 {'@', 0x0000002f, 0x00003855},/*        /        x-advance: 56.332031 */
 2973 {'M', 0x42515556, 0xc2c22223},
 2974 {'l', 0xc221ddde, 0x42d2ccce},
 2975 {'l', 0xc129999c, 0xb6000000},
 2976 {'l', 0x42222223, 0xc2d2ccce},
 2977 {'l', 0x41288888, 0x00000000},
 2978 {'@', 0x00000030, 0x00004cbb},/*        0        x-advance: 76.730469 */
 2979 {'M', 0x428a0000, 0xc225ddde},
 2980 {'q', 0x00000000, 0x41beeeef},
 2981 {0, 0xc1044440, 0x42055555},
 2982 {'q', 0xc1033334, 0x41177779},
 2983 {0, 0xc1b2aaac, 0x41177779},
 2984 {'q', 0xc15bbbbc, 0x34c00000},
 2985 {0, 0xc1b11111, 0xc1133334},
 2986 {'9', 0xffb7ffbe, 0xff00ffbc},
 2987 {'l', 0x00000000, 0xc182aaac},
 2988 {'q', 0x00000000, 0xc1be6668},
 2989 {0, 0x41055555, 0xc203bbbc},
 2990 {'q', 0x41055556, 0xc1133330},
 2991 {0, 0x41b22224, 0xc1133330},
 2992 {'q', 0x415eeef0, 0x00000000},
 2993 {0, 0x41b1999a, 0x410eeee8},
 2994 {'9', 0x00460042, 0x00fd0044},
 2995 {'6', 0x00820000, 0xff7aff9d},
 2996 {'q', 0x00000000, 0xc1833334},
 2997 {0, 0xc0955558, 0xc1b9999c},
 2998 {'8', 0xca93cadb, 0x349500bb},
 2999 {'9', 0x0034ffdb, 0x00b3ffda},
 3000 {'l', 0x00000000, 0x419e6668},
 3001 {'q', 0x00000000, 0x41822222},
 3002 {0, 0x40977778, 0x41bbbbbc},
 3003 {'8', 0x396c3926, 0xc86c0048},
 3004 {'q', 0x40933338, 0xc0e44446},
 3005 {0, 0x40955558, 0xc1b88888},
 3006 {'l', 0x00000000, 0xc19b3334},
 3007 {'@', 0x00000031, 0x00004cbb},/*        1        x-advance: 76.730469 */
 3008 {'M', 0x42426667, 0xc2c33334},
 3009 {'l', 0x00000000, 0x42c33334},
 3010 {'l', 0xc1455554, 0x00000000},
 3011 {'l', 0x00000000, 0xc2a46667},
 3012 {'l', 0xc1c6eef0, 0x41111110},
 3013 {'l', 0xb5800000, 0xc1322220},
 3014 {'l', 0x420d1111, 0xc1555558},
 3015 {'l', 0x3ff77780, 0x00000000},
 3016 {'@', 0x00000032, 0x00004cbb},/*        2        x-advance: 76.730469 */
 3017 {'M', 0x428f5556, 0xc1222223},
 3018 {'l', 0x00000000, 0x41222223},
 3019 {'4', 0x0000fe04, 0xffba0000},
 3020 {'l', 0x4203bbbc, 0xc212aaac},
 3021 {'q', 0x41022220, 0xc1133330},
 3022 {0, 0x412eeef0, 0xc1699994},
 3023 {'8', 0xaa16d516, 0x9fddc700},
 3024 {'q', 0xc08cccc8, 0xc0a22220},
 3025 {0, 0xc1477778, 0xc0a22220},
 3026 {'q', 0xc11bbbbc, 0x00000000},
 3027 {0, 0xc1688888, 0x40b11110},
 3028 {'9', 0x002cffda, 0x0071ffda},
 3029 {'l', 0xc1455556, 0x00000000},
 3030 {'q', 0x35000000, 0xc1444440},
 3031 {0, 0x41011112, 0xc1a88888},
 3032 {'q', 0x41011112, 0xc10cccc8},
 3033 {0, 0x41bccccd, 0xc10cccc8},
 3034 {'q', 0x415bbbbc, 0x00000000},
 3035 {0, 0x41abbbbc, 0x40e44440},
 3036 {'q', 0x40f999a0, 0x40e44440},
 3037 {0, 0x40f999a0, 0x41966668},
 3038 {'q', 0x00000000, 0x41088884},
 3039 {0, 0xc0a88888, 0x41899998},
 3040 {'9', 0x0044ffd6, 0x0087ff99},
 3041 {'l', 0xc1d00001, 0x41e1999a},
 3042 {'l', 0x4242aaac, 0x35800000},
 3043 {'@', 0x00000033, 0x00004cbb},/*        3        x-advance: 76.730469 */
 3044 {'M', 0x41d08889, 0xc231ddde},
 3045 {'4', 0xffaf0000, 0x00000048},
 3046 {'q', 0x41188888, 0xbd888800},
 3047 {0, 0x41633334, 0xc0999998},
 3048 {'q', 0x40955558, 0xc0977780},
 3049 {0, 0x40955558, 0xc13cccd0},
 3050 {'q', 0x00000000, 0xc1888888},
 3051 {0, 0xc1877778, 0xc1888888},
 3052 {'8', 0x249b00c2, 0x60da23da},
 3053 {'l', 0xc1455556, 0x00000000},
 3054 {'q', 0x35000000, 0xc1322220},
 3055 {0, 0x41033334, 0xc1977778},
 3056 {'q', 0x41044444, 0xc0f99990},
 3057 {0, 0x41addddf, 0xc0f99990},
 3058 {'q', 0x41522220, 0x00000000},
 3059 {0, 0x41a9999a, 0x40e00000},
 3060 {'q', 0x41022220, 0x40ddddd0},
 3061 {0, 0x41022220, 0x41a3bbbc},
 3062 {'8', 0x5ce32b00, 0x4ca431e4},
 3063 {'8', 0x4d69194d, 0x691c341c},
 3064 {'q', 0x00000000, 0x4159999a},
 3065 {0, 0xc10ccccc, 0x41a80000},
 3066 {'q', 0xc10ccccc, 0x40eccccf},
 3067 {0, 0xc1af7778, 0x40eccccf},
 3068 {'q', 0xc14aaaac, 0xb4000000},
 3069 {0, 0xc1adddde, 0xc0e00001},
 3070 {'9', 0xffc8ffb8, 0xff60ffb8},
 3071 {'l', 0x41455556, 0x00000000},
 3072 {'8', 0x62273d00, 0x246c2428},
 3073 {'8', 0xdd6b0043, 0x9427dd27},
 3074 {'q', 0x00000000, 0xc1111112},
 3075 {0, 0xc0b33338, 0xc1555556},
 3076 {'q', 0xc0b33330, 0xc08aaaa8},
 3077 {0, 0xc1700000, 0xc08aaaa8},
 3078 {'l', 0xc10cccce, 0x00000000},
 3079 {'@', 0x00000034, 0x00004cbb},/*        4        x-advance: 76.730469 */
 3080 {'M', 0x40622223, 0xc1ee6667},
 3081 {'l', 0x422ddddf, 0xc2868889},
 3082 {'l', 0x41522220, 0x00000000},
 3083 {'l', 0x00000000, 0x4280ccce},
 3084 {'l', 0x4158888c, 0xb6800000},
 3085 {'l', 0x00000000, 0x41222222},
 3086 {'l', 0xc158888c, 0x00000000},
 3087 {'l', 0x00000000, 0x41b44445},
 3088 {'l', 0xc1455554, 0x00000000},
 3089 {'4', 0xff4c0000, 0x0000fe9e},
 3090 {'6', 0xffc60000, 0xffea0070},
 3091 {'l', 0x41f22223, 0x00000000},
 3092 {'l', 0x00000000, 0xc23eaaab},
 3093 {'l', 0xbfc44440, 0x402eeee0},
 3094 {'l', 0xc1e5dddf, 0x4233bbbd},
 3095 {'@', 0x00000035, 0x00004cbb},/*        5        x-advance: 76.730469 */
 3096 {'M', 0x41bd5556, 0xc238cccd},
 3097 {'l', 0xc11dddde, 0xc0222230},
 3098 {'l', 0x409bbbbc, 0xc2415556},
 3099 {'l', 0x42473333, 0x00000000},
 3100 {'4', 0x005b0000, 0x0000fec6},
 3101 {'l', 0xc03bbbc0, 0x41d33334},
 3102 {'q', 0x40eaaab0, 0xc0866668},
 3103 {0, 0x4181999a, 0xc0866668},
 3104 {'q', 0x41566668, 0x00000000},
 3105 {0, 0x41a91112, 0x410ddde0},
 3106 {'q', 0x40f99998, 0x410ccccc},
 3107 {0, 0x40f99998, 0x41bd5556},
 3108 {'q', 0x00000000, 0x415eeef0},
 3109 {0, 0xc0f33330, 0x41b91112},
 3110 {'q', 0xc0f33338, 0x41122221},
 3111 {0, 0xc1b91112, 0x41122221},
 3112 {'q', 0xc13cccce, 0x34c00000},
 3113 {0, 0xc1a33334, 0xc0d33333},
 3114 {'9', 0xffcbffbc, 0xff5effb1},
 3115 {'l', 0x413bbbbd, 0x00000000},
 3116 {'q', 0x40155550, 0x4185ddde},
 3117 {0, 0x4194cccd, 0x4185ddde},
 3118 {'q', 0x410bbbbc, 0x35800000},
 3119 {0, 0x41588888, 0xc0bdddde},
 3120 {'q', 0x409999a0, 0xc0bdddde},
 3121 {0, 0x409999a0, 0xc1808888},
 3122 {'q', 0x00000000, 0xc1122224},
 3123 {0, 0xc0a22228, 0xc1755558},
 3124 {'q', 0xc0a00000, 0xc0c88888},
 3125 {0, 0xc1655554, 0xc0c88888},
 3126 {'8', 0x0db500cf, 0x24cd0de7},
 3127 {'@', 0x00000036, 0x00004cbb},/*        6        x-advance: 76.730469 */
 3128 {'M', 0x428c6667, 0xc1fd5556},
 3129 {'q', 0x00000000, 0x415cccce},
 3130 {0, 0xc0f77778, 0x41bb3334},
 3131 {'q', 0xc0f55558, 0x41199999},
 3132 {0, 0xc1b33334, 0x41199999},
 3133 {'q', 0xc1277778, 0x34c00000},
 3134 {0, 0xc18b3334, 0xc0b11111},
 3135 {'q', 0xc0ddddde, 0xc0b33333},
 3136 {0, 0xc1266667, 0xc1622222},
 3137 {'9', 0xffbcffe5, 0xff74ffe5},
 3138 {'l', 0x00000000, 0xc0b999a0},
 3139 {'q', 0x00000000, 0xc15aaaa8},
 3140 {0, 0x40733334, 0xc1d33334},
 3141 {'q', 0x4077777c, 0xc14bbbb8},
 3142 {0, 0x415eeef1, 0xc1a6eef0},
 3143 {'9', 0xffbf0050, 0xffbf00e6},
 3144 {'4', 0x00000008, 0x00530000},
 3145 {'q', 0xc14eeef0, 0x00000000},
 3146 {0, 0xc1a11112, 0x40911110},
 3147 {'q', 0xc0e44448, 0x40911110},
 3148 {0, 0xc12aaaac, 0x413cccd0},
 3149 {'q', 0xc05ddde0, 0x40e66660},
 3150 {0, 0xc0866668, 0x41777778},
 3151 {'q', 0x40f77778, 0xc10bbbc0},
 3152 {0, 0x41a6eef0, 0xc10bbbc0},
 3153 {'q', 0x411aaaac, 0x00000000},
 3154 {0, 0x417ccccc, 0x40955558},
 3155 {'q', 0x40c66668, 0x40955558},
 3156 {0, 0x41122224, 0x41411114},
 3157 {'9', 0x003a0017, 0x007a0017},
 3158 {'m', 0xc243bbbc, 0xc0777780},
 3159 {'q', 0xb6000000, 0x414eeef2},
 3160 {0, 0x40b77774, 0x419e6668},
 3161 {'8', 0x3668362e, 0xcf690044},
 3162 {'q', 0x40977778, 0xc0c88888},
 3163 {0, 0x40977778, 0xc1800000},
 3164 {'q', 0x00000000, 0xc10aaaaa},
 3165 {0, 0xc08aaab0, 0xc178888a},
 3166 {'8', 0xca96cade, 0x1ea300cd},
 3167 {'q', 0xc0a8888c, 0x40777770},
 3168 {0, 0xc0eaaaac, 0x41166668},
 3169 {'l', 0x00000000, 0x40955550},
 3170 {'@', 0x00000037, 0x00004cbb},/*        7        x-advance: 76.730469 */
 3171 {'M', 0x428d999a, 0xc2c22223},
 3172 {'l', 0x00000000, 0x40dddde0},
 3173 {'l', 0xc220cccd, 0x42b44445},
 3174 {'l', 0xc1500002, 0x00000000},
 3175 {'l', 0x4220888a, 0xc2adddde},
 3176 {'l', 0xc2522223, 0x00000000},
 3177 {'l', 0xb5000000, 0xc1222228},
 3178 {'l', 0x42833334, 0x00000000},
 3179 {'@', 0x00000038, 0x00004cbb},/*        8        x-advance: 76.730469 */
 3180 {'M', 0x428a8889, 0xc1d22223},
 3181 {'q', 0x00000000, 0x41555556},
 3182 {0, 0xc10eeef0, 0x41a3bbbc},
 3183 {'q', 0xc10ddddc, 0x40e44447},
 3184 {0, 0xc1af7778, 0x40e44447},
 3185 {'q', 0xc1511112, 0xb4000000},
 3186 {0, 0xc1b00000, 0xc0e44445},
 3187 {'q', 0xc10ddddf, 0xc0e44446},
 3188 {0, 0xc10ddddf, 0xc1a3bbbc},
 3189 {'q', 0x00000000, 0xc1022224},
 3190 {0, 0x408aaaac, 0xc1655558},
 3191 {'8', 0xb55ece23, 0xbaaee7cd},
 3192 {'q', 0xc06eeef0, 0xc0b77778},
 3193 {0, 0xc06eeef0, 0xc14ddddc},
 3194 {'q', 0x00000000, 0xc14bbbc0},
 3195 {0, 0x41011112, 0xc19d5558},
 3196 {'q', 0x41022222, 0xc0ddddd0},
 3197 {0, 0x41a44445, 0xc0ddddd0},
 3198 {'q', 0x41477778, 0x00000000},
 3199 {0, 0x41a44444, 0x40ddddd0},
 3200 {'q', 0x41022220, 0x40dddde0},
 3201 {0, 0x41022220, 0x419d5558},
 3202 {'8', 0x67e23900, 0x46ae2de2},
 3203 {'q', 0x40f11110, 0x404cccd0},
 3204 {0, 0x41400000, 0x41177778},
 3205 {'9', 0x00320023, 0x00720023},
 3206 {'m', 0xc169999c, 0xc2355556},
 3207 {'8', 0xa1dcc600, 0xdba2dbdc},
 3208 {'8', 0x24a300c6, 0x61dd23dd},
 3209 {'8', 0x60233c00, 0x245e2423},
 3210 {'8', 0xdc5d003a, 0xa024dc24},
 3211 {'m', 0x400cccd0, 0x42344446},
 3212 {'8', 0x96d7bf00, 0xd795d7d7},
 3213 {'8', 0x299500bd, 0x6ad929d9},
 3214 {'8', 0x68274300, 0x256c2528},
 3215 {'8', 0xdb6c0044, 0x9827db27},
 3216 {'@', 0x00000039, 0x00004cbb},/*        9        x-advance: 76.730469 */
 3217 {'M', 0x42877778, 0xc25aaaab},
 3218 {'q', 0x00000000, 0x41177778},
 3219 {0, 0xbfd55540, 0x41991110},
 3220 {'q', 0xbfcccd00, 0x4119999c},
 3221 {0, 0xc0caaab0, 0x418ddddf},
 3222 {'q', 0xc0955558, 0x41011112},
 3223 {0, 0xc15ddde0, 0x41500001},
 3224 {'9', 0x0027ffb7, 0x0027ff34},
 3225 {'l', 0x00000000, 0xc1277778},
 3226 {'q', 0x416bbbbe, 0x00000000},
 3227 {0, 0x41aeeeef, 0xc0933334},
 3228 {'q', 0x40e66668, 0xc0933334},
 3229 {0, 0x41200004, 0xc1400000},
 3230 {'q', 0x40377770, 0xc0eeeef0},
 3231 {0, 0x404cccc0, 0xc17ddde0},
 3232 {'8', 0x3bb624e2, 0x16a316d5},
 3233 {'q', 0xc119999a, 0x00000000},
 3234 {0, 0xc17bbbbc, 0xc09999a0},
 3235 {'q', 0xc0c44446, 0xc0999998},
 3236 {0, 0xc1111112, 0xc1433334},
 3237 {'q', 0xc03bbbbc, 0xc0eeeef0},
 3238 {0, 0xc03bbbbc, 0xc1766664},
 3239 {'q', 0x00000000, 0xc15ddde0},
 3240 {0, 0x40f33334, 0xc1bd5558},
 3241 {'q', 0x40f55556, 0xc11dddd8},
 3242 {0, 0x41b44446, 0xc11dddd8},
 3243 {'q', 0x41311110, 0x00000000},
 3244 {0, 0x418eeeee, 0x40b77770},
 3245 {'q', 0x40dbbbc0, 0x40b77780},
 3246 {0, 0x411eeef4, 0x416bbbc0},
 3247 {'9', 0x00480019, 0x00960019},
 3248 {'6', 0x00230000, 0xffaafe79},
 3249 {'q', 0xb6000000, 0x410aaab0},
 3250 {0, 0x408aaaa8, 0x417bbbc0},
 3251 {'8', 0x386a3823, 0xe25b0032},
 3252 {'9', 0xffe20029, 0xffb5003c},
 3253 {'l', 0x00000000, 0xc09bbbc0},
 3254 {'q', 0x00000000, 0xc1544448},
 3255 {0, 0xc0b55558, 0xc1a2aaac},
 3256 {'8', 0xc898c8d4, 0x349600bc},
 3257 {'q', 0xc0955554, 0x40ceeef0},
 3258 {0, 0xc0955554, 0x41811110},
 3259 {'@', 0x0000003a, 0x00002111},/*        :        x-advance: 33.066406 */
 3260 {'M', 0x410dddde, 0xc0d11112},
 3261 {'8', 0xd60fe700, 0xef2def10},
 3262 {'8', 0x112d001d, 0x2a101110},
 3263 {'8', 0x29f01800, 0x11d311f1},
 3264 {'8', 0xefd300e3, 0xd7f1eff1},
 3265 {'m', 0x3d888880, 0xc26b7778},
 3266 {'8', 0xd60fe700, 0xef2def10},
 3267 {'8', 0x112d001d, 0x2a101110},
 3268 {'8', 0x29f01800, 0x11d311f1},
 3269 {'8', 0xefd300e3, 0xd7f1eff1},
 3270 {'@', 0x0000003b, 0x00001cdd},/*        ;        x-advance: 28.863281 */
 3271 {'M', 0x40eaaaab, 0xc282cccd},
 3272 {'8', 0xd60fe700, 0xef2def10},
 3273 {'8', 0x112d001d, 0x2a101110},
 3274 {'8', 0x29f01800, 0x11d311f1},
 3275 {'8', 0xefd300e3, 0xd7f1eff1},
 3276 {'m', 0x41611112, 0x424aeeef},
 3277 {'l', 0x00000000, 0x411eeef0},
 3278 {'8', 0x66e83000, 0x5abc35e8},
 3279 {'l', 0xc0e00000, 0xc09bbbbe},
 3280 {'9', 0xffb90033, 0xff6e0034},
 3281 {'l', 0x00000000, 0xc12eeef0},
 3282 {'l', 0x41411112, 0x00000000},
 3283 {'@', 0x0000003c, 0x00004566},/*        <        x-advance: 69.398438 */
 3284 {'M', 0x426d5556, 0xc1511112},
 3285 {'l', 0xc25a2223, 0xc1ca2223},
 3286 {'l', 0x35800000, 0xc11aaaac},
 3287 {'l', 0x425a2223, 0xc1c9999a},
 3288 {'l', 0x00000000, 0x41511114},
 3289 {'l', 0xc2266667, 0x41891110},
 3290 {'l', 0x42266667, 0x4186eef0},
 3291 {'l', 0x00000000, 0x41511112},
 3292 {'@', 0x0000003d, 0x00004aee},/*        =        x-advance: 74.929688 */
 3293 {'M', 0x42837778, 0xc2820000},
 3294 {'l', 0x00000000, 0x412bbbb8},
 3295 {'4', 0x0000fe44, 0xffab0000},
 3296 {'6', 0x000001bc, 0x00dd0000},
 3297 {'l', 0x00000000, 0x412bbbbc},
 3298 {'l', 0xc25e6667, 0x00000000},
 3299 {'l', 0xb5800000, 0xc12bbbbc},
 3300 {'l', 0x425e6667, 0x00000000},
 3301 {'@', 0x0000003e, 0x00004766},/*        >        x-advance: 71.398438 */
 3302 {'M', 0x41100000, 0xc292aaab},
 3303 {'l', 0x4263bbbc, 0x41c9999a},
 3304 {'l', 0x00000000, 0x411bbbbc},
 3305 {'l', 0xc263bbbc, 0x41ca2222},
 3306 {'l', 0x00000000, 0xc14bbbbc},
 3307 {'l', 0x42308889, 0xc18c4444},
 3308 {'l', 0xc2308889, 0xc189999a},
 3309 {'l', 0x00000000, 0xc14bbbbc},
 3310 {'@', 0x0000003f, 0x00004088},/*        ?        x-advance: 64.531250 */
 3311 {'M', 0x4210cccd, 0xc1daaaab},
 3312 {'l', 0xc1466666, 0x00000000},
 3313 {'q', 0x3d888900, 0xc11aaaae},
 3314 {0, 0x402aaaa8, 0xc167777a},
 3315 {'8', 0xa646da14, 0xbb3fdc23},
 3316 {'8', 0xa91bdf1b, 0xaae3ca00},
 3317 {'8', 0xe0ace0e3, 0x19ad00d2},
 3318 {'9', 0x0019ffdc, 0x0050ffdb},
 3319 {'l', 0xc1455556, 0x00000000},
 3320 {'q', 0x3e0888a0, 0xc1344448},
 3321 {0, 0x41000001, 0xc18d5558},
 3322 {'q', 0x40fdddde, 0xc0ccccc0},
 3323 {0, 0x419bbbbc, 0xc0ccccc0},
 3324 {'q', 0x414bbbbc, 0x00000000},
 3325 {0, 0x419d5556, 0x40d99990},
 3326 {'q', 0x40e00000, 0x40d999a0},
 3327 {0, 0x40e00000, 0x41944444},
 3328 {'q', 0x00000000, 0x410eeef0},
 3329 {0, 0xc0a88888, 0x4180888a},
 3330 {'q', 0xc0a88888, 0x40e22228},
 3331 {0, 0xc1377778, 0x414cccd0},
 3332 {'9', 0x002dffcf, 0x0086ffcf},
 3333 {'m', 0xc14eeeee, 0x41a91111},
 3334 {'8', 0xd80ee800, 0xf02bf00e},
 3335 {'8', 0x102b001c, 0x280e100e},
 3336 {'8', 0x27f21600, 0x10d510f2},
 3337 {'8', 0xf0d500e4, 0xd9f2f0f2},
 3338 {'@', 0x00000040, 0x00007a99},/*        @        x-advance: 122.597656 */
 3339 {'M', 0x42a8aaab, 0x41c22223},
 3340 {'8', 0x23a318db, 0x0b970bc9},
 3341 {'q', 0xc1caaaac, 0x00000000},
 3342 {0, 0xc21cccce, 0xc1855556},
 3343 {'q', 0xc15ccccb, 0xc185ddde},
 3344 {0, 0xc1499998, 0xc235999a},
 3345 {'q', 0x3f4cccd0, 0xc1922222},
 3346 {0, 0x40fddde0, 0xc2026666},
 3347 {'q', 0x40e66668, 0xc1666668},
 3348 {0, 0x419d5556, 0xc1b55558},
 3349 {'q', 0x41488888, 0xc1044440},
 3350 {0, 0x41ea2224, 0xc1044440},
 3351 {'q', 0x41cd5554, 0x00000000},
 3352 {0, 0x421bbbbc, 0x4185dddc},
 3353 {'q', 0x41555558, 0x4185ddde},
 3354 {0, 0x41433330, 0x42348889},
 3355 {'q', 0xbeaaaa00, 0x41033336},
 3356 {0, 0xc0488880, 0x41822223},
 3357 {'q', 0xc02eef00, 0x41011112},
 3358 {0, 0xc10aaaa8, 0x41566668},
 3359 {'q', 0xc0bbbbc0, 0x40a88889},
 3360 {0, 0xc1777778, 0x40a88889},
 3361 {'q', 0xc1488890, 0x00000000},
 3362 {0, 0xc1800004, 0xc1355556},
 3363 {'q', 0xc0e66660, 0x41355556},
 3364 {0, 0xc18eeeee, 0x41355556},
 3365 {'q', 0xc11ccccc, 0x35000000},
 3366 {0, 0xc1677778, 0xc1011111},
 3367 {'q', 0xc0955558, 0xc1011112},
 3368 {0, 0xc05ddde0, 0xc1a9999a},
 3369 {'q', 0x3fc44440, 0xc18c4444},
 3370 {0, 0x41200000, 0xc1de6666},
 3371 {'q', 0x4108888c, 0xc1255554},
 3372 {0, 0x4196eef2, 0xc1255554},
 3373 {'8', 0x115a0039, 0x273e1021},
 3374 {'l', 0xc05999a0, 0x4213bbbc},
 3375 {'8', 0x64114dfa, 0x16321618},
 3376 {'q', 0x41011118, 0x00000000},
 3377 {0, 0x41466668, 0xc0fbbbbc},
 3378 {'q', 0x408cccd0, 0xc0fbbbbe},
 3379 {0, 0x409bbbc0, 0xc1991112},
 3380 {'q', 0x3f911100, 0xc1c6eeee},
 3381 {0, 0xc1144448, 0xc21c0001},
 3382 {'q', 0xc1255550, 0xc1622220},
 3383 {0, 0xc2062222, 0xc1622220},
 3384 {'q', 0xc1a80000, 0x00000000},
 3385 {0, 0xc205ddde, 0x41733338},
 3386 {'q', 0xc1477778, 0x41733330},
 3387 {0, 0xc1577778, 0x421e6666},
 3388 {'q', 0xbf9999a0, 0x41c77778},
 3389 {0, 0x411eeeee, 0x421d5556},
 3390 {'q', 0x41333336, 0x41666668},
 3391 {0, 0x4201ddde, 0x41666668},
 3392 {'8', 0xf55e002e, 0xe251f530},
 3393 {'6', 0x003c0014, 0xfe5ffed8},
 3394 {'q', 0xbf5dde00, 0x4116666a},
 3395 {0, 0x3fe66660, 0x4168888c},
 3396 {'8', 0x29442915, 0xe83a001b},
 3397 {'9', 0xffe8001e, 0xffaf0034},
 3398 {'4', 0xfffc0000, 0xfef50018},
 3399 {'8', 0xf1c0f1e3, 0x3b9b00c6},
 3400 {'q', 0xc0aaaaa8, 0x40eeeef0},
 3401 {0, 0xc0d55550, 0x41b08888},
 3402 {'@', 0x00000041, 0x00005911},/*        A        x-advance: 89.066406 */
 3403 {'M', 0x3ff77778, 0x00000000},
 3404 {'l', 0x42140000, 0xc2c22223},
 3405 {'l', 0x41344444, 0x00000000},
 3406 {'l', 0x42148889, 0x42c22223},
 3407 {'l', 0xc1533330, 0x00000000},
 3408 {'l', 0xc1144448, 0xc1cb3334},
 3409 {'4', 0x0000febc, 0x00cbffb7},
 3410 {'6', 0x0000ff97, 0xfee100d1},
 3411 {'l', 0x4203bbbc, 0x00000000},
 3412 {'l', 0xc183bbbc, 0xc2351112},
 3413 {'l', 0xc183bbbc, 0x42351112},
 3414 {'[', 0x007a0041, 0x000000cc},/*kerning*/
 3415 {'@', 0x00000042, 0x00005511},/*        B        x-advance: 85.066406 */
 3416 {'M', 0x429aaaab, 0xc1e00001},
 3417 {'q', 0x00000000, 0x4159999b},
 3418 {0, 0xc10cccc8, 0x41a66667},
 3419 {'9', 0x0039ffbb, 0x0039ff46},
 3420 {'4', 0x0000fef0, 0xfcf80000},
 3421 {'l', 0x41fe6668, 0x00000000},
 3422 {'q', 0x416eeef0, 0x00000000},
 3423 {0, 0x41ba2222, 0x40c66670},
 3424 {'q', 0x41066668, 0x40c44440},
 3425 {0, 0x41066668, 0x419d5554},
 3426 {'8', 0x60e23500, 0x40ad29e2},
 3427 {'q', 0x41033338, 0x40111110},
 3428 {0, 0x41488888, 0x41099998},
 3429 {'9', 0x00320023, 0x00740023},
 3430 {'m', 0xc254cccd, 0xc26a2224},
 3431 {'4', 0x00f60000, 0x0000009a},
 3432 {'8', 0xdf6a0042, 0xa528df28},
 3433 {'9', 0xff8a0000, 0xff87ff70},
 3434 {'6', 0x0000ff63, 0x01d50143},
 3435 {'q', 0x00000000, 0xc1022220},
 3436 {0, 0xc08eeef8, 0xc14ccccc},
 3437 {'9', 0xffdbffdd, 0xffdbff8f},
 3438 {'4', 0x0000ff53, 0x01170000},
 3439 {'l', 0x41a91112, 0x00000000},
 3440 {'q', 0x41122220, 0x00000000},
 3441 {0, 0x41633334, 0xc0955556},
 3442 {'q', 0x40a22228, 0xc0977776},
 3443 {0, 0x40a22228, 0xc14bbbbd},
 3444 {'@', 0x00000043, 0x000058dd},/*        C        x-advance: 88.863281 */
 3445 {'M', 0x428bbbbc, 0xc1f6eef0},
 3446 {'l', 0x414cccd0, 0x00000000},
 3447 {'q', 0xbfbbbbc0, 0x415cccce},
 3448 {0, 0xc1266668, 0x41b80001},
 3449 {'q', 0xc10eeef0, 0x41133333},
 3450 {0, 0xc1d33334, 0x41133333},
 3451 {'q', 0xc1877778, 0x34c00000},
 3452 {0, 0xc1daaaab, 0xc1411111},
 3453 {'9', 0xff9fffae, 0xfeffffac},
 3454 {'l', 0x00000000, 0xc1266668},
 3455 {'q', 0x00000000, 0xc1a33334},
 3456 {0, 0x41277778, 0xc202eef0},
 3457 {'q', 0x4128888a, 0xc1455550},
 3458 {0, 0x41e44446, 0xc1455550},
 3459 {'q', 0x4183bbbc, 0x00000000},
 3460 {0, 0x41caaaaa, 0x41111110},
 3461 {'9', 0x00480046, 0x00bb0052},
 3462 {'l', 0xc14cccd0, 0x00000000},
 3463 {'q', 0xbfbbbbc0, 0xc1222228},
 3464 {0, 0xc0d11110, 0xc1800000},
 3465 {'q', 0xc0a22220, 0xc0bddde0},
 3466 {0, 0xc182aaaa, 0xc0bddde0},
 3467 {'q', 0xc14ddde0, 0x00000000},
 3468 {0, 0xc19c4446, 0x41177778},
 3469 {'9', 0x004bffcb, 0x00c7ffcb},
 3470 {'l', 0x00000000, 0x411cccd0},
 3471 {'q', 0x00000000, 0x41655556},
 3472 {0, 0x40c22224, 0x41c3bbbc},
 3473 {'q', 0x40c22220, 0x41211111},
 3474 {0, 0x41980000, 0x41211111},
 3475 {'q', 0x41444444, 0x00000000},
 3476 {0, 0x418a2222, 0xc0b77778},
 3477 {'q', 0x40a22228, 0xc0b77776},
 3478 {0, 0x40d77778, 0xc1800000},
 3479 {'@', 0x00000044, 0x00005999},/*        D        x-advance: 89.597656 */
 3480 {'M', 0x41344445, 0x00000000},
 3481 {'4', 0xfcf80000, 0x000000db},
 3482 {'q', 0x41991112, 0x00000000},
 3483 {0, 0x41f7777a, 0x41455558},
 3484 {'9', 0x0062005e, 0x010a005e},
 3485 {'l', 0x00000000, 0x40b99998},
 3486 {'q', 0x00000000, 0x41a88889},
 3487 {0, 0xc13eeef0, 0x42055556},
 3488 {'9', 0x0062ffa2, 0x0062ff00},
 3489 {'6', 0x0000ff2e, 0xfd4c0066},
 3490 {'4', 0x02600000, 0x0000006b},
 3491 {'q', 0x41788888, 0x00000000},
 3492 {0, 0x41bb3334, 0xc119999a},
 3493 {'9', 0xffb4003e, 0xff34003e},
 3494 {'l', 0x00000000, 0xc0bddde0},
 3495 {'q', 0x00000000, 0xc185ddde},
 3496 {0, 0xc0fbbbb8, 0xc1ceeeee},
 3497 {'q', 0xc0fbbbc0, 0xc1122228},
 3498 {0, 0xc1b1999c, 0xc1122228},
 3499 {'l', 0xc1699998, 0x00000000},
 3500 {'@', 0x00000045, 0x00004d99},/*        E        x-advance: 77.597656 */
 3501 {'M', 0x41344445, 0x00000000},
 3502 {'l', 0x00000000, 0xc2c22223},
 3503 {'l', 0x42740001, 0x00000000},
 3504 {'l', 0x00000000, 0x41288888},
 3505 {'l', 0xc2408889, 0x00000000},
 3506 {'l', 0x00000000, 0x41f9999c},
 3507 {'l', 0x42280001, 0x00000000},
 3508 {'l', 0x00000000, 0x41277778},
 3509 {'l', 0xc2280001, 0x00000000},
 3510 {'l', 0x00000000, 0x4209999a},
 3511 {'l', 0x42433333, 0x00000000},
 3512 {'l', 0x00000000, 0x41277778},
 3513 {'l', 0xc276aaab, 0x00000000},
 3514 {'[', 0x00540045, 0x00000155},/*kerning*/
 3515 {'@', 0x00000046, 0x00004b77},/*        F        x-advance: 75.464844 */
 3516 {'M', 0x41344445, 0x00000000},
 3517 {'l', 0x00000000, 0xc2c22223},
 3518 {'l', 0x42708889, 0x00000000},
 3519 {'l', 0x00000000, 0x41288888},
 3520 {'l', 0xc23d1111, 0x00000000},
 3521 {'l', 0x00000000, 0x4204888a},
 3522 {'l', 0x4222aaab, 0x00000000},
 3523 {'l', 0x00000000, 0x41288888},
 3524 {'l', 0xc222aaab, 0x00000000},
 3525 {'l', 0x00000000, 0x422b7778},
 3526 {'l', 0xc14ddddf, 0x00000000},
 3527 {'[', 0x00540046, 0x00000155},/*kerning*/
 3528 {'@', 0x00000047, 0x00005d00},/*        G        x-advance: 93.000000 */
 3529 {'M', 0x42a60001, 0xc2415556},
 3530 {'l', 0x00000000, 0x420e2222},
 3531 {'q', 0xc02eef00, 0x40800006},
 3532 {0, 0xc1266668, 0x41111114},
 3533 {'q', 0xc0f55560, 0x40a22223},
 3534 {0, 0xc1bf777a, 0x40a22223},
 3535 {'q', 0xc18dddde, 0xb4000000},
 3536 {0, 0xc1e91111, 0xc1422222},
 3537 {'9', 0xff9fffa5, 0xfef0ffa5},
 3538 {'l', 0x00000000, 0xc0f11110},
 3539 {'q', 0x00000000, 0xc1ad5558},
 3540 {0, 0x41222223, 0xc2077778},
 3541 {'q', 0x41222222, 0xc1433330},
 3542 {0, 0x41e77777, 0xc1433330},
 3543 {'q', 0x41855556, 0x00000000},
 3544 {0, 0x41ca2222, 0x41066660},
 3545 {'9', 0x00430045, 0x00aa0054},
 3546 {'l', 0xc14ddde0, 0x00000000},
 3547 {'q', 0xbfaaaac0, 0xc0fbbbc0},
 3548 {0, 0xc0d33338, 0xc1588888},
 3549 {'q', 0xc0a66668, 0xc0b55550},
 3550 {0, 0xc182aaac, 0xc0b55550},
 3551 {'q', 0xc1566664, 0x00000000},
 3552 {0, 0xc19dddde, 0x41177778},
 3553 {'9', 0x004bffce, 0x00ccffcd},
 3554 {'l', 0x00000000, 0x41000000},
 3555 {'q', 0x00000000, 0x41866667},
 3556 {0, 0x40f33334, 0x41d22223},
 3557 {'q', 0x40f33338, 0x41166667},
 3558 {0, 0x41a0888a, 0x41166667},
 3559 {'q', 0x41255554, 0x00000000},
 3560 {0, 0x416eeef0, 0xc0199998},
 3561 {'9', 0xffed0024, 0xffdb0034},
 3562 {'l', 0x00000000, 0xc1adddde},
 3563 {'l', 0xc1b3bbbc, 0x00000000},
 3564 {'l', 0x00000000, 0xc1266668},
 3565 {'l', 0x420d1112, 0x00000000},
 3566 {'@', 0x00000048, 0x00006166},/*        H        x-advance: 97.398438 */
 3567 {'M', 0x42922223, 0x00000000},
 3568 {'l', 0x00000000, 0xc2337778},
 3569 {'l', 0xc243bbbd, 0x00000000},
 3570 {'l', 0x00000000, 0x42337778},
 3571 {'l', 0xc14ddddf, 0x00000000},
 3572 {'l', 0x00000000, 0xc2c22223},
 3573 {'l', 0x414ddddf, 0x00000000},
 3574 {'l', 0x00000000, 0x4226eef0},
 3575 {'l', 0x4243bbbd, 0x00000000},
 3576 {'l', 0x00000000, 0xc226eef0},
 3577 {'l', 0x414cccc8, 0x00000000},
 3578 {'l', 0x00000000, 0x42c22223},
 3579 {'l', 0xc14cccc8, 0x00000000},
 3580 {'@', 0x00000049, 0x00002522},/*        I        x-advance: 37.132812 */
 3581 {'M', 0x41c88889, 0xc2c22223},
 3582 {'l', 0x00000000, 0x42c22223},
 3583 {'l', 0xc14dddde, 0x00000000},
 3584 {'l', 0x00000000, 0xc2c22223},
 3585 {'l', 0x414dddde, 0x00000000},
 3586 {'@', 0x0000004a, 0x00004b55},/*        J        x-advance: 75.332031 */
 3587 {'M', 0x42500001, 0xc2c22223},
 3588 {'4', 0x00000066, 0x02250000},
 3589 {'q', 0x00000000, 0x41666668},
 3590 {0, 0xc10aaaac, 0x41b0888a},
 3591 {'q', 0xc1099998, 0x40f33333},
 3592 {0, 0xc1af7778, 0x40f33333},
 3593 {'q', 0xc1566666, 0xb4000000},
 3594 {0, 0xc1b08888, 0xc0dddddf},
 3595 {'9', 0xffc9ffbc, 0xff56ffbc},
 3596 {'l', 0x414ddddf, 0x00000000},
 3597 {'8', 0x6b274900, 0x22662228},
 3598 {'q', 0x40f33338, 0x00000000},
 3599 {0, 0x414aaaac, 0xc09bbbbc},
 3600 {'q', 0x40a44448, 0xc09bbbba},
 3601 {0, 0x40a44448, 0xc1655555},
 3602 {'l', 0x00000000, 0xc2897778},
 3603 {'@', 0x0000004b, 0x000055aa},/*        K        x-advance: 85.664062 */
 3604 {'M', 0x428caaab, 0x00000000},
 3605 {'l', 0xc2095556, 0xc234cccd},
 3606 {'l', 0xc13ddddc, 0x41455554},
 3607 {'l', 0x00000000, 0x42037778},
 3608 {'l', 0xc14ddddf, 0x00000000},
 3609 {'l', 0x00000000, 0xc2c22223},
 3610 {'l', 0x414ddddf, 0x00000000},
 3611 {'l', 0x00000000, 0x423f7779},
 3612 {'l', 0x422c8889, 0xc23f7779},
 3613 {'l', 0x41777778, 0x00000000},
 3614 {'l', 0xc2188889, 0x422b7778},
 3615 {'l', 0x42244445, 0x4258ccce},
 3616 {'l', 0xc1755558, 0x00000000},
 3617 {'@', 0x0000004c, 0x00004988},/*        L        x-advance: 73.531250 */
 3618 {'M', 0x428c4445, 0xc1277778},
 3619 {'l', 0x00000000, 0x41277778},
 3620 {'l', 0xc26b7779, 0x00000000},
 3621 {'l', 0x35800000, 0xc2c22223},
 3622 {'l', 0x414ddddf, 0x00000000},
 3623 {'l', 0x00000000, 0x42ad3334},
 3624 {'l', 0x42380001, 0x00000000},
 3625 {'[', 0x0041004c, 0x00000144},/*kerning*/
 3626 {'@', 0x0000004d, 0x00007733},/*        M        x-advance: 119.199219 */
 3627 {'M', 0x426e6667, 0xc18f7778},
 3628 {'l', 0x41fdddde, 0xc29e4445},
 3629 {'l', 0x41844444, 0x00000000},
 3630 {'l', 0x00000000, 0x42c22223},
 3631 {'l', 0xc14cccc8, 0x00000000},
 3632 {'l', 0x00000000, 0xc2177778},
 3633 {'l', 0x3fa22200, 0xc2226666},
 3634 {'l', 0xc1ff7778, 0x429ceeef},
 3635 {'l', 0xc11bbbbc, 0x00000000},
 3636 {'l', 0xc1feeeef, 0xc29d3334},
 3637 {'l', 0x3fa22220, 0x4222eef0},
 3638 {'l', 0x00000000, 0x42177778},
 3639 {'l', 0xc14ccccd, 0x00000000},
 3640 {'l', 0x00000000, 0xc2c22223},
 3641 {'l', 0x41844444, 0x00000000},
 3642 {'l', 0x41fe6668, 0x429e4445},
 3643 {'@', 0x0000004e, 0x00006166},/*        N        x-advance: 97.398438 */
 3644 {'M', 0x42abddde, 0xc2c22223},
 3645 {'l', 0x00000000, 0x42c22223},
 3646 {'l', 0xc14eeef0, 0x00000000},
 3647 {'l', 0xc2437777, 0xc295bbbc},
 3648 {'l', 0x00000000, 0x4295bbbc},
 3649 {'l', 0xc14ddddf, 0x00000000},
 3650 {'l', 0x00000000, 0xc2c22223},
 3651 {'l', 0x414ddddf, 0x00000000},
 3652 {'l', 0x42444445, 0x42962223},
 3653 {'l', 0x00000000, 0xc2962223},
 3654 {'l', 0x414bbbb8, 0x00000000},
 3655 {'@', 0x0000004f, 0x00005dee},/*        O        x-advance: 93.929688 */
 3656 {'M', 0x42ac0001, 0xc235ddde},
 3657 {'q', 0x00000000, 0x41aeeeef},
 3658 {0, 0xc12999a0, 0x42095555},
 3659 {'q', 0xc1299998, 0x41477779},
 3660 {0, 0xc1e2aaaa, 0x41477779},
 3661 {'q', 0xc18a2223, 0x34c00000},
 3662 {0, 0xc1e1999b, 0xc1477778},
 3663 {'9', 0xff9dffa9, 0xfeeeffa9},
 3664 {'l', 0xb5000000, 0xc0c44448},
 3665 {'q', 0x00000000, 0xc1ae6666},
 3666 {0, 0x412dddde, 0xc2091111},
 3667 {'q', 0x412dddde, 0xc1488888},
 3668 {0, 0x41e11111, 0xc1488888},
 3669 {'q', 0x418cccd0, 0x00000000},
 3670 {0, 0x41e1999c, 0x41455550},
 3671 {'9', 0x00620055, 0x010d0056},
 3672 {'6', 0x00370000, 0xffceff9b},
 3673 {'q', 0x00000000, 0xc18aaaac},
 3674 {0, 0xc0dddde0, 0xc1d44444},
 3675 {'q', 0xc0dddde0, 0xc1133338},
 3676 {0, 0xc19b3334, 0xc1133338},
 3677 {'q', 0xc13eeef0, 0x00000000},
 3678 {0, 0xc1991111, 0x41133338},
 3679 {'9', 0x0049ffc7, 0x00d4ffc7},
 3680 {'l', 0x00000000, 0x40c88890},
 3681 {'q', 0x00000000, 0x418bbbbb},
 3682 {0, 0x40e66668, 0x41d5ddde},
 3683 {'q', 0x40e88888, 0x41133333},
 3684 {0, 0x4199999a, 0x41133333},
 3685 {'q', 0x41488888, 0x00000000},
 3686 {0, 0x419aaaaa, 0xc1133333},
 3687 {'q', 0x40dbbbc0, 0xc1144446},
 3688 {0, 0x40dbbbc0, 0xc1d5ddde},
 3689 {'l', 0x00000000, 0xc0c88890},
 3690 {'@', 0x00000050, 0x00005622},/*        P        x-advance: 86.132812 */
 3691 {'M', 0x41c11112, 0xc2184445},
 3692 {'l', 0x00000000, 0x42184445},
 3693 {'4', 0x0000ff9a, 0xfcf80000},
 3694 {'l', 0x420f3334, 0x00000000},
 3695 {'q', 0x41844444, 0x00000000},
 3696 {0, 0x41ca2222, 0x41055558},
 3697 {'q', 0x410cccd0, 0x41055558},
 3698 {0, 0x410cccd0, 0x41aa2224},
 3699 {'q', 0x00000000, 0x41611110},
 3700 {0, 0xc10cccd0, 0x41addddc},
 3701 {'9', 0x003dffbb, 0x003dff36},
 3702 {'6', 0x0000ff49, 0xfe7d0000},
 3703 {'4', 0x01300000, 0x000000b7},
 3704 {'q', 0x41355554, 0x00000000},
 3705 {0, 0x41822222, 0xc0a88888},
 3706 {'8', 0x9427d627, 0x96d9c500},
 3707 {'q', 0xc09ddde0, 0xc0bbbbc0},
 3708 {0, 0xc1822222, 0xc0bbbbc0},
 3709 {'l', 0xc1b77778, 0x00000000},
 3710 {'[', 0x00740050, 0x000000ee},/*kerning*/
 3711 {'[', 0x00760050, 0x00000100},/*kerning*/
 3712 {'[', 0x00790050, 0x00000100},/*kerning*/
 3713 {'@', 0x00000051, 0x00005dee},/*        Q        x-advance: 93.929688 */
 3714 {'M', 0x42ab7778, 0x41066667},
 3715 {'4', 0x0040ffbb, 0xff7eff5d},
 3716 {'q', 0xc0999998, 0x3f99999b},
 3717 {0, 0xc1222220, 0x3f99999b},
 3718 {'q', 0xc18a2224, 0x00000000},
 3719 {0, 0xc1e1999b, 0xc1477778},
 3720 {'9', 0xff9dffa9, 0xfeeeffa9},
 3721 {'l', 0xb5000000, 0xc0c44448},
 3722 {'q', 0x00000000, 0xc1ae6666},
 3723 {0, 0x412dddde, 0xc2091111},
 3724 {'q', 0x412dddde, 0xc1488888},
 3725 {0, 0x41e11112, 0xc1488888},
 3726 {'q', 0x418cccce, 0x00000000},
 3727 {0, 0x41e1999c, 0x41455550},
 3728 {'9', 0x00620055, 0x010d0056},
 3729 {'l', 0x00000000, 0x40dddde0},
 3730 {'q', 0x00000000, 0x415ffffe},
 3731 {0, 0xc08eeef0, 0x41c22222},
 3732 {'9', 0x0051ffdd, 0x007fff9d},
 3733 {'6', 0x006d008a, 0xfe1fff98},
 3734 {'q', 0x00000000, 0xc18aaaac},
 3735 {0, 0xc0dddde0, 0xc1d44444},
 3736 {'q', 0xc0dddde0, 0xc1133338},
 3737 {0, 0xc19b3334, 0xc1133338},
 3738 {'q', 0xc13eeef0, 0x00000000},
 3739 {0, 0xc1991112, 0x41133338},
 3740 {'9', 0x0049ffc7, 0x00d4ffc7},
 3741 {'l', 0x00000000, 0x40c88890},
 3742 {'q', 0x00000000, 0x418bbbbb},
 3743 {0, 0x40e66668, 0x41d5ddde},
 3744 {'q', 0x40e8888c, 0x41133333},
 3745 {0, 0x4199999b, 0x41133333},
 3746 {'q', 0x41488888, 0x00000000},
 3747 {0, 0x419aaaaa, 0xc1133333},
 3748 {'q', 0x40dbbbc0, 0xc1144446},
 3749 {0, 0x40dbbbc0, 0xc1d5ddde},
 3750 {'l', 0x00000000, 0xc0c88890},
 3751 {'@', 0x00000052, 0x00005422},/*        R        x-advance: 84.132812 */
 3752 {'M', 0x42880000, 0x00000000},
 3753 {'l', 0xc1a88888, 0xc21d5556},
 3754 {'l', 0xc1b66666, 0x00000000},
 3755 {'l', 0x00000000, 0x421d5556},
 3756 {'4', 0x0000ff9a, 0xfcf80000},
 3757 {'l', 0x42008889, 0x00000000},
 3758 {'q', 0x4182aaac, 0x00000000},
 3759 {0, 0x41c91114, 0x40eeeef0},
 3760 {'q', 0x410dddd8, 0x40eeeef0},
 3761 {0, 0x410dddd8, 0x41ad5558},
 3762 {'q', 0x00000000, 0x41111110},
 3763 {0, 0xc09ddde0, 0x417ddddc},
 3764 {'9', 0x0035ffda, 0x0050ff94},
 3765 {'4', 0x014900b6, 0x00060000},
 3766 {'6', 0x0000ff93, 0xfd4cfea2},
 3767 {'4', 0x01250000, 0x0000009d},
 3768 {'q', 0x41255554, 0x00000000},
 3769 {0, 0x41788888, 0xc0a88888},
 3770 {'8', 0x9a2ad62a, 0x95d8bd00},
 3771 {'q', 0xc0a00000, 0xc0a44450},
 3772 {0, 0xc1811112, 0xc0a44450},
 3773 {'l', 0xc19a2222, 0x00000000},
 3774 {'@', 0x00000053, 0x00005111},/*        S        x-advance: 81.066406 */
 3775 {'M', 0x427c0001, 0xc1c44445},
 3776 {'q', 0x00000000, 0xc0d55554},
 3777 {0, 0xc0911110, 0xc12aaaaa},
 3778 {'q', 0xc08eeef0, 0xc0800000},
 3779 {0, 0xc196eef0, 0xc1033334},
 3780 {'q', 0xc1666668, 0xc0888888},
 3781 {0, 0xc1b66667, 0xc12cccd0},
 3782 {'q', 0xc1055556, 0xc0d33330},
 3783 {0, 0xc1055556, 0xc18e6664},
 3784 {'q', 0x00000000, 0xc1355558},
 3785 {0, 0x41100000, 0xc196eef0},
 3786 {'q', 0x41111112, 0xc0f11110},
 3787 {0, 0x41c00000, 0xc0f11110},
 3788 {'q', 0x41833334, 0x00000000},
 3789 {0, 0x41ca2224, 0x41100000},
 3790 {'9', 0x00480047, 0x00a20047},
 3791 {'l', 0xc14cccd0, 0x00000000},
 3792 {'q', 0x00000000, 0xc1022220},
 3793 {0, 0xc0a88888, 0xc1577778},
 3794 {'q', 0xc0a88888, 0xc0aaaaa0},
 3795 {0, 0xc1811112, 0xc0aaaaa0},
 3796 {'q', 0xc1244444, 0x00000000},
 3797 {0, 0xc1733332, 0x40911110},
 3798 {'8', 0x59d923d9, 0x51293000},
 3799 {'q', 0x40a88888, 0x40800000},
 3800 {0, 0x41888889, 0x40eaaab0},
 3801 {'q', 0x4186eef0, 0x40977778},
 3802 {0, 0x41c4ccce, 0x413bbbbc},
 3803 {'q', 0x40f77770, 0x40dddde0},
 3804 {0, 0x40f77770, 0x41922222},
 3805 {'q', 0x00000000, 0x413dddde},
 3806 {0, 0xc1144440, 0x41977778},
 3807 {'q', 0xc1144448, 0x40e22223},
 3808 {0, 0xc1c4ccce, 0x40e22223},
 3809 {'q', 0xc10eeef0, 0xb4000000},
 3810 {0, 0xc18b3334, 0xc0555556},
 3811 {'q', 0xc1066666, 0xc0555556},
 3812 {0, 0xc15ddddf, 0xc11ddddf},
 3813 {'9', 0xffccffd5, 0xff7effd5},
 3814 {'l', 0x414cccce, 0x00000000},
 3815 {'q', 0x00000000, 0x411eeef0},
 3816 {0, 0x40e88888, 0x41677779},
 3817 {'q', 0x40e88888, 0x40911110},
 3818 {0, 0x4184ccce, 0x40911110},
 3819 {'q', 0x41211110, 0x00000000},
 3820 {0, 0x41777778, 0xc0844444},
 3821 {'q', 0x40aeeef0, 0xc0866666},
 3822 {0, 0x40aeeef0, 0xc1344445},
 3823 {'@', 0x00000054, 0x00005177},/*        T        x-advance: 81.464844 */
 3824 {'M', 0x40555556, 0xc2ad1112},
 3825 {'l', 0x00000000, 0xc1288888},
 3826 {'l', 0x42960000, 0x00000000},
 3827 {'l', 0x00000000, 0x41288888},
 3828 {'l', 0xc1f9999a, 0x00000000},
 3829 {'l', 0x00000000, 0x42ad1112},
 3830 {'l', 0xc14aaaac, 0x00000000},
 3831 {'l', 0x00000000, 0xc2ad1112},
 3832 {'l', 0xc1f91111, 0x00000000},
 3833 {'[', 0x00540054, 0x00000111},/*kerning*/
 3834 {'[', 0x00560054, 0x00000111},/*kerning*/
 3835 {'[', 0x00570054, 0x00000100},/*kerning*/
 3836 {'[', 0x00590054, 0x00000111},/*kerning*/
 3837 {'@', 0x00000055, 0x00005888},/*        U        x-advance: 88.531250 */
 3838 {'M', 0x4285999a, 0xc2c22223},
 3839 {'4', 0x00000066, 0x020d0000},
 3840 {'q', 0x00000000, 0x41833334},
 3841 {0, 0xc1288888, 0x41c4ccce},
 3842 {'q', 0xc128888c, 0x41022221},
 3843 {0, 0xc1c55558, 0x41022221},
 3844 {'q', 0xc16dddde, 0x34c00000},
 3845 {0, 0xc1c80000, 0xc1022222},
 3846 {'9', 0xffbfffb0, 0xff3cffb0},
 3847 {'4', 0xfdf30000, 0x00000065},
 3848 {'l', 0x00000000, 0x42835556},
 3849 {'q', 0x00000000, 0x41366666},
 3850 {0, 0x40c44444, 0x4186eef0},
 3851 {'q', 0x40c66668, 0x40acccca},
 3852 {0, 0x4181999a, 0x40acccca},
 3853 {'q', 0x41222224, 0x00000000},
 3854 {0, 0x41822222, 0xc0accccc},
 3855 {'q', 0x40c44448, 0xc0aeeef2},
 3856 {0, 0x40c44448, 0xc186eef0},
 3857 {'l', 0x00000000, 0xc2835556},
 3858 {'@', 0x00000056, 0x000056ee},/*        V        x-advance: 86.929688 */
 3859 {'M', 0x42aa4445, 0xc2c22223},
 3860 {'l', 0xc20fbbbd, 0x42c22223},
 3861 {'l', 0xc1366664, 0x00000000},
 3862 {'l', 0xc20f7778, 0xc2c22223},
 3863 {'l', 0x415eeeef, 0x00000000},
 3864 {'l', 0x41dc4444, 0x42a00001},
 3865 {'l', 0x41de6668, 0xc2a00001},
 3866 {'l', 0x415eeef0, 0x00000000},
 3867 {'[', 0x00290056, 0x00000155},/*kerning*/
 3868 {'[', 0x005d0056, 0x00000122},/*kerning*/
 3869 {'[', 0x007d0056, 0x00000144},/*kerning*/
 3870 {'@', 0x00000057, 0x00007922},/*        W        x-advance: 121.132812 */
 3871 {'M', 0x42ec6667, 0xc2c22223},
 3872 {'l', 0xc1bbbbbc, 0x42c22223},
 3873 {'l', 0xc13aaaa8, 0x00000000},
 3874 {'l', 0xc1a00002, 0xc28d7778},
 3875 {'l', 0xbfc44440, 0xc0ecccd0},
 3876 {'l', 0xbfc44440, 0x40ecccd0},
 3877 {'l', 0xc1a5ddde, 0x428d7778},
 3878 {'l', 0xc13aaaac, 0x00000000},
 3879 {'l', 0xc1bc4445, 0xc2c22223},
 3880 {'l', 0x414ccccc, 0x00000000},
 3881 {'l', 0x41755556, 0x4284ccce},
 3882 {'l', 0x3ff77780, 0x414dddda},
 3883 {'l', 0x402aaab0, 0xc1388888},
 3884 {'l', 0x419a2222, 0xc2877778},
 3885 {'l', 0x412bbbbc, 0x00000000},
 3886 {'l', 0x4195dde0, 0x42877778},
 3887 {'l', 0x402eeee0, 0x413cccce},
 3888 {'l', 0x40044440, 0xc1533334},
 3889 {'l', 0x41700000, 0xc284aaab},
 3890 {'l', 0x414ddde0, 0x00000000},
 3891 {'[', 0x00290057, 0x00000100},/*kerning*/
 3892 {'[', 0x00540057, 0x000000ee},/*kerning*/
 3893 {'[', 0x005d0057, 0x000000cc},/*kerning*/
 3894 {'[', 0x007d0057, 0x000000ee},/*kerning*/
 3895 {'@', 0x00000058, 0x00005599},/*        X        x-advance: 85.597656 */
 3896 {'M', 0x419ccccd, 0xc2c22223},
 3897 {'l', 0x41baaaab, 0x4214ccce},
 3898 {'l', 0x41baaaac, 0xc214ccce},
 3899 {'l', 0x41700000, 0x00000000},
 3900 {'l', 0xc1f55556, 0x42404445},
 3901 {'l', 0x41fb3336, 0x42440001},
 3902 {'l', 0xc1722228, 0x00000000},
 3903 {'l', 0xc1bf7778, 0xc217bbbc},
 3904 {'l', 0xc1bf7777, 0x4217bbbc},
 3905 {'l', 0xc1722224, 0x00000000},
 3906 {'l', 0x41fb3335, 0xc2440001},
 3907 {'l', 0xc1f55557, 0xc2404445},
 3908 {'l', 0x41700000, 0x00000000},
 3909 {'[', 0x00560058, 0x000000ee},/*kerning*/
 3910 {'@', 0x00000059, 0x00005200},/*        Y        x-advance: 82.000000 */
 3911 {'M', 0x417bbbbd, 0xc2c22223},
 3912 {'l', 0x41c9999a, 0x4242eef0},
 3913 {'l', 0x41ca2224, 0xc242eef0},
 3914 {'l', 0x41699998, 0x00000000},
 3915 {'l', 0xc205ddde, 0x42733334},
 3916 {'l', 0x00000000, 0x42111112},
 3917 {'l', 0xc14ddde0, 0x00000000},
 3918 {'l', 0x00000000, 0xc2111112},
 3919 {'l', 0xc205ddde, 0xc2733334},
 3920 {'l', 0x416bbbbd, 0x00000000},
 3921 {'[', 0x00290059, 0x00000155},/*kerning*/
 3922 {'[', 0x00540059, 0x00000122},/*kerning*/
 3923 {'[', 0x00560059, 0x00000133},/*kerning*/
 3924 {'[', 0x00570059, 0x00000122},/*kerning*/
 3925 {'[', 0x00580059, 0x000000dd},/*kerning*/
 3926 {'[', 0x00590059, 0x00000133},/*kerning*/
 3927 {'[', 0x005d0059, 0x00000133},/*kerning*/
 3928 {'[', 0x007d0059, 0x00000144},/*kerning*/
 3929 {'@', 0x0000005a, 0x000051cc},/*        Z        x-advance: 81.796875 */
 3930 {'M', 0x40d55556, 0xc2ad1112},
 3931 {'l', 0x00000000, 0xc1288888},
 3932 {'l', 0x42873334, 0x00000000},
 3933 {'l', 0x00000000, 0x41155558},
 3934 {'l', 0xc2555556, 0x429a8889},
 3935 {'l', 0x425dddde, 0x00000000},
 3936 {'l', 0x00000000, 0x41277778},
 3937 {'l', 0xc28d3333, 0x00000000},
 3938 {'l', 0xb6400000, 0xc119999a},
 3939 {'l', 0x4254ccce, 0xc299dddf},
 3940 {'l', 0xc2515556, 0x00000000},
 3941 {'[', 0x0041005a, 0x000000dd},/*kerning*/
 3942 {'@', 0x0000005b, 0x00002433},/*        [        x-advance: 36.199219 */
 3943 {'M', 0x420b7778, 0xc2dddddf},
 3944 {'l', 0x00000000, 0x41222228},
 3945 {'l', 0xc14bbbbc, 0x00000000},
 3946 {'l', 0x00000000, 0x42deeeef},
 3947 {'l', 0x414bbbbc, 0x36400000},
 3948 {'l', 0x00000000, 0x41222223},
 3949 {'l', 0xc1c8888a, 0x00000000},
 3950 {'l', 0x35800000, 0xc303bbbc},
 3951 {'l', 0x41c8888a, 0xb7000000},
 3952 {'@', 0x0000005c, 0x00003811},/*       \         x-advance: 56.066406 */
 3953 {'M', 0x422d1112, 0x41055556},
 3954 {'l', 0xc2222223, 0xc2d2ccce},
 3955 {'l', 0x413bbbbc, 0x00000000},
 3956 {'l', 0x42222223, 0x42d2ccce},
 3957 {'l', 0xc13bbbbc, 0xb6000000},
 3958 {'@', 0x0000005d, 0x00002433},/*        ]        x-advance: 36.199219 */
 3959 {'M', 0x3f2aaaab, 0xc2c9999a},
 3960 {'l', 0x00000000, 0xc1222228},
 3961 {'l', 0x41c9999b, 0x00000000},
 3962 {'l', 0x00000000, 0x4303bbbc},
 3963 {'l', 0xc1c9999b, 0x36c00000},
 3964 {'l', 0x35300000, 0xc1222223},
 3965 {'l', 0x414ccccd, 0x00000000},
 3966 {'l', 0x00000000, 0xc2deeeef},
 3967 {'l', 0xc14ccccd, 0x00000000},
 3968 {'@', 0x0000005e, 0x00003911},/*        ^        x-advance: 57.066406 */
 3969 {'M', 0x40888889, 0xc2426667},
 3970 {'l', 0x419f7778, 0xc241dddf},
 3971 {'l', 0x41088888, 0x00000000},
 3972 {'l', 0x419eeef0, 0x4241dddf},
 3973 {'l', 0xc1377778, 0x00000000},
 3974 {'l', 0xc14aaaaa, 0xc200cccd},
 3975 {'l', 0xc14bbbbd, 0x4200cccd},
 3976 {'l', 0xc1377778, 0x00000000},
 3977 {'@', 0x0000005f, 0x00003d99},/*        _        x-advance: 61.597656 */
 3978 {'M', 0x4275999a, 0x00000000},
 3979 {'l', 0x00000000, 0x41222223},
 3980 {'l', 0xc2748889, 0x00000000},
 3981 {'l', 0x34900000, 0xc1222223},
 3982 {'l', 0x42748889, 0x00000000},
 3983 {'@', 0x00000060, 0x00002a33},/*        `        x-advance: 42.199219 */
 3984 {'M', 0x4195ddde, 0xc2ccccce},
 3985 {'l', 0x414ddde0, 0x419cccd0},
 3986 {'l', 0xc129999a, 0x00000000},
 3987 {'l', 0xc189999a, 0xc19cccd0},
 3988 {'l', 0x416eeeee, 0x00000000},
 3989 {'@', 0x00000061, 0x00004a44},/*        a        x-advance: 74.265625 */
 3990 {'M', 0x4257bbbc, 0x00000000},
 3991 {'8', 0xc4f3ecf7, 0x32bb1de5},
 3992 {'q', 0xc0a66668, 0x40266668},
 3993 {0, 0xc13ddde0, 0x40266668},
 3994 {'q', 0xc1311112, 0xb4000000},
 3995 {0, 0xc18dddde, 0xc0c66667},
 3996 {'q', 0xc0d55557, 0xc0c66668},
 3997 {0, 0xc0d55557, 0xc1733334},
 3998 {'q', 0x00000000, 0xc139999a},
 3999 {0, 0x410cccce, 0xc18ccccd},
 4000 {'9', 0xffd00046, 0xffd000bd},
 4001 {'4', 0x00000061, 0xffd30000},
 4002 {'8', 0xafe2cd00, 0xe2a6e2e2},
 4003 {'8', 0x1ba600c9, 0x3fde1bde},
 4004 {'l', 0xc1455557, 0x00000000},
 4005 {'q', 0x00000000, 0xc0f77778},
 4006 {0, 0x40f9999a, 0xc168888c},
 4007 {'q', 0x40f9999c, 0xc0d99990},
 4008 {0, 0x41a6eeef, 0xc0d99990},
 4009 {'q', 0x413bbbbc, 0x00000000},
 4010 {0, 0x419a2224, 0x40c00000},
 4011 {'9', 0x002f003c, 0x0091003c},
 4012 {'l', 0x00000000, 0x4201999a},
 4013 {'9', 0x00500000, 0x007e0014},
 4014 {'4', 0x00080000, 0x0000ff9a},
 4015 {'m', 0xc1a3bbbc, 0xc1177778},
 4016 {'8', 0xe65c0035, 0xc537e627},
 4017 {'4', 0xff8a0000, 0x0000ffa5},
 4018 {'q', 0xc1a66666, 0x3ecccd00},
 4019 {0, 0xc1a66666, 0x41555558},
 4020 {'8', 0x451b2900, 0x1c521c1b},
 4021 {'@', 0x00000062, 0x00004caa},/*        b        x-advance: 76.664062 */
 4022 {'M', 0x428ceeef, 0xc20d1112},
 4023 {'q', 0x00000000, 0x417cccd0},
 4024 {0, 0xc0eaaaa8, 0x41d1999b},
 4025 {'q', 0xc0eaaaa8, 0x41266667},
 4026 {0, 0xc1a5ddde, 0x41266667},
 4027 {'9', 0x0000ff93, 0xffb3ff58},
 4028 {'l', 0xbf2aaaa0, 0x41055556},
 4029 {'l', 0xc1355556, 0x00000000},
 4030 {'4', 0xfccd0000, 0x00000063},
 4031 {'l', 0x00000000, 0x42184446},
 4032 {'q', 0x40eaaaac, 0xc1122220},
 4033 {0, 0x41a44446, 0xc1122220},
 4034 {'q', 0x41599998, 0x00000000},
 4035 {0, 0x41a6eeee, 0x41222220},
 4036 {'9', 0x0051003a, 0x00d5003a},
 4037 {'6', 0x000b0000, 0xff22ff06},
 4038 {'8', 0x1aa900cb, 0x3fcc19df},
 4039 {'l', 0x00000000, 0x41fb3334},
 4040 {'8', 0x40352613, 0x1a571a22},
 4041 {'q', 0x41200000, 0x00000000},
 4042 {0, 0x41655554, 0xc0f55556},
 4043 {'9', 0xffc30023, 0xff6d0023},
 4044 {'l', 0x00000000, 0xbfb33320},
 4045 {'q', 0x00000000, 0xc12bbbbc},
 4046 {0, 0xc0866668, 0xc1944446},
 4047 {'q', 0xc0844440, 0xc0fbbbb8},
 4048 {0, 0xc16aaaac, 0xc0fbbbb8},
 4049 {'@', 0x00000063, 0x00004777},/*        c        x-advance: 71.464844 */
 4050 {'M', 0x42191112, 0xc10ccccd},
 4051 {'8', 0xe15c0034, 0xb02be128},
 4052 {'l', 0x413bbbb8, 0x00000000},
 4053 {'q', 0xbeeeee00, 0x411aaaab},
 4054 {0, 0xc10ddddc, 0x41877778},
 4055 {'q', 0xc1066664, 0x40e66667},
 4056 {0, 0xc19eeeee, 0x40e66667},
 4057 {'q', 0xc1822223, 0xb4000000},
 4058 {0, 0xc1c1999b, 0xc12bbbbc},
 4059 {'9', 0xffabffc2, 0xff36ffc2},
 4060 {'l', 0x00000000, 0xc0333330},
 4061 {'q', 0x00000000, 0xc168888c},
 4062 {0, 0x40fbbbbd, 0xc1ca2224},
 4063 {'q', 0x40fddde0, 0xc12bbbb8},
 4064 {0, 0x41c1999b, 0xc12bbbb8},
 4065 {'q', 0x414aaaa8, 0x00000000},
 4066 {0, 0x41a3bbbc, 0x40f11110},
 4067 {'9', 0x003b003e, 0x00940042},
 4068 {'l', 0xc13bbbb8, 0x00000000},
 4069 {'8', 0xa6d8cbfd, 0xdba1dbdc},
 4070 {'8', 0x1ea100c4, 0x4ed01ede},
 4071 {'9', 0x002ffff3, 0x0061fff3},
 4072 {'l', 0x00000000, 0x40333330},
 4073 {'8', 0x620d3200, 0x4e302f0d},
 4074 {'q', 0x408aaaac, 0x40733334},
 4075 {0, 0x41400002, 0x40733334},
 4076 {'@', 0x00000064, 0x00004d00},/*        d        x-advance: 77.000000 */
 4077 {'M', 0x425fbbbc, 0x00000000},
 4078 {'l', 0xbf199980, 0xc0f77778},
 4079 {'q', 0xc0ecccd0, 0x41111111},
 4080 {0, 0xc1a4ccce, 0x41111111},
 4081 {'q', 0xc14aaaaa, 0x34c00000},
 4082 {0, 0xc1a3bbbc, 0xc1244444},
 4083 {'9', 0xffaeffc2, 0xff32ffc1},
 4084 {'l', 0x00000000, 0xbff77780},
 4085 {'q', 0x00000000, 0xc1844446},
 4086 {0, 0x40f9999b, 0xc1d55556},
 4087 {'q', 0x40fbbbbe, 0xc1222220},
 4088 {0, 0x41a5ddde, 0xc1222220},
 4089 {'9', 0x00000065, 0x004400a0},
 4090 {'l', 0x00000000, 0xc215dde0},
 4091 {'4', 0x00000063, 0x03330000},
 4092 {'6', 0x0000ffa6, 0xfee6fed7},
 4093 {'q', 0x00000000, 0x412bbbbe},
 4094 {0, 0x40911114, 0x4193bbbd},
 4095 {'q', 0x40911110, 0x40f55556},
 4096 {0, 0x4168888a, 0x40f55556},
 4097 {'9', 0x0000005b, 0xffad0088},
 4098 {'l', 0x00000000, 0xc204ccce},
 4099 {'q', 0xc0b11110, 0xc1244444},
 4100 {0, 0xc1877778, 0xc1244444},
 4101 {'q', 0xc1211110, 0x00000000},
 4102 {0, 0xc16aaaaa, 0x40fbbbb8},
 4103 {'q', 0xc0911114, 0x40f999a0},
 4104 {0, 0xc0911114, 0x41944446},
 4105 {'l', 0x00000000, 0x3fb33320},
 4106 {'@', 0x00000065, 0x00004866},/*        e        x-advance: 72.398438 */
 4107 {'M', 0x4284eeef, 0xc149999a},
 4108 {'q', 0xc0622210, 0x40aaaaab},
 4109 {0, 0xc11ffffc, 0x411aaaab},
 4110 {'q', 0xc0ceeef0, 0x40888889},
 4111 {0, 0xc1891112, 0x40888889},
 4112 {'q', 0xc1711112, 0xb4000000},
 4113 {0, 0xc1c11112, 0xc11cccce},
 4114 {'9', 0xffb2ffb8, 0xff38ffb8},
 4115 {'l', 0xb5000000, 0xc0333330},
 4116 {'q', 0x00000000, 0xc13ccccc},
 4117 {0, 0x408eeeef, 0xc1a08888},
 4118 {'q', 0x40911112, 0xc1055558},
 4119 {0, 0x413bbbbd, 0xc14aaab0},
 4120 {'q', 0x40e66668, 0xc08cccc0},
 4121 {0, 0x41755554, 0xc08cccc0},
 4122 {'q', 0x4177777c, 0x00000000},
 4123 {0, 0x41b44446, 0x41222220},
 4124 {'9', 0x00500039, 0x00c90039},
 4125 {'4', 0x002c0000, 0x0000fe7a},
 4126 {'q', 0x3e8888c0, 0x411eeef0},
 4127 {0, 0x40bbbbc0, 0x41877778},
 4128 {'q', 0x40b55558, 0x40dddde0},
 4129 {0, 0x4178888c, 0x40dddde0},
 4130 {'8', 0xeb580034, 0xc73feb24},
 4131 {'6', 0x002f003b, 0xfe6bff1b},
 4132 {'q', 0xc0eaaaa8, 0x00000000},
 4133 {0, 0xc1466666, 0x40aaaaa8},
 4134 {'9', 0x002affd8, 0x007affce},
 4135 {'4', 0x00000120, 0xfff90000},
 4136 {'8', 0x95dfc7fd, 0xce97cee3},
 4137 {'@', 0x00000066, 0x00002f77},/*        f        x-advance: 47.464844 */
 4138 {'M', 0x422c8889, 0xc27aaaac},
 4139 {'l', 0xc1755556, 0x00000000},
 4140 {'l', 0x00000000, 0x427aaaac},
 4141 {'l', 0xc1455556, 0x00000000},
 4142 {'l', 0x00000000, 0xc27aaaac},
 4143 {'0', 0xb50000a5, 0xc000005b},
 4144 {'q', 0x3e088880, 0xc1377778},
 4145 {0, 0x40ccccd0, 0xc18c4444},
 4146 {'q', 0x40caaaa8, 0xc0c22220},
 4147 {0, 0x418a2222, 0xc0c22220},
 4148 {'9', 0x00000020, 0x00080044},
 4149 {'l', 0xbf2aaa80, 0x41211110},
 4150 {'8', 0xfccbfcea, 0x699c009e},
 4151 {'l', 0x00000000, 0x41000000},
 4152 {'l', 0x41755556, 0x00000000},
 4153 {'l', 0x00000000, 0x41177778},
 4154 {'[', 0x00220066, 0x00000111},/*kerning*/
 4155 {'[', 0x00270066, 0x00000111},/*kerning*/
 4156 {'[', 0x00290066, 0x00000155},/*kerning*/
 4157 {'[', 0x005d0066, 0x00000133},/*kerning*/
 4158 {'[', 0x007d0066, 0x00000144},/*kerning*/
 4159 {'@', 0x00000067, 0x00004caa},/*        g        x-advance: 76.664062 */
 4160 {'M', 0x42133334, 0x41e3bbbd},
 4161 {'8', 0xeb9300d4, 0xb298ebbf},
 4162 {'l', 0x40ceeef0, 0xc0eaaaac},
 4163 {'q', 0x41000000, 0x411bbbbc},
 4164 {0, 0x419aaaab, 0x411bbbbc},
 4165 {'q', 0x410bbbbc, 0x00000000},
 4166 {0, 0x415eeef0, 0xc09bbbbc},
 4167 {'9', 0xffd90029, 0xff8d0029},
 4168 {'l', 0x00000000, 0xc0caaaab},
 4169 {'q', 0xc0eaaab0, 0x4109999a},
 4170 {0, 0xc1a1999a, 0x4109999a},
 4171 {'q', 0xc1500002, 0xb4000000},
 4172 {0, 0xc1a55556, 0xc1266668},
 4173 {'9', 0xffadffc3, 0xff2fffc3},
 4174 {'l', 0x00000000, 0xbfb33320},
 4175 {'q', 0x00000000, 0xc1844446},
 4176 {0, 0x40f33334, 0xc1d55556},
 4177 {'q', 0x40f55554, 0xc1222220},
 4178 {0, 0x41a6eeef, 0xc1222220},
 4179 {'9', 0x0000006a, 0x004a00a4},
 4180 {'4', 0xffc00004, 0x00000059},
 4181 {'l', 0x00000000, 0x428d3334},
 4182 {'q', 0x00000000, 0x41655556},
 4183 {0, 0xc1088888, 0x41b1999a},
 4184 {'9', 0x003effbc, 0x003eff50},
 4185 {'m', 0xc1900001, 0xc27eeef0},
 4186 {'q', 0x00000000, 0x412bbbbe},
 4187 {0, 0x408eeef0, 0x4193bbbd},
 4188 {'q', 0x40911110, 0x40f55556},
 4189 {0, 0x4168888a, 0x40f55556},
 4190 {'9', 0x0000005d, 0xffab0089},
 4191 {'l', 0x00000000, 0xc2037778},
 4192 {'8', 0xc5cdddee, 0xe8ace8df},
 4193 {'q', 0xc1211110, 0x00000000},
 4194 {0, 0xc169999a, 0x40fbbbb8},
 4195 {'q', 0xc0911110, 0x40f999a0},
 4196 {0, 0xc0911110, 0x41944446},
 4197 {'l', 0x00000000, 0x3fb33320},
 4198 {'@', 0x00000068, 0x00004b33},/*        h        x-advance: 75.199219 */
 4199 {'M', 0x421d5556, 0xc27c4445},
 4200 {'8', 0x19ad00d1, 0x42c719dc},
 4201 {'l', 0x00000000, 0x424e2223},
 4202 {'l', 0xc1455555, 0x00000000},
 4203 {'4', 0xfccd0000, 0x00000062},
 4204 {'l', 0x00000000, 0x421b7779},
 4205 {'q', 0x41033334, 0xc11eeeec},
 4206 {0, 0x41aa2224, 0xc11eeeec},
 4207 {'q', 0x41299998, 0x00000000},
 4208 {0, 0x41866666, 0x40bdddd0},
 4209 {'9', 0x002f0032, 0x009f0032},
 4210 {'4', 0x017c0000, 0x0000ff9d},
 4211 {'l', 0x00000000, 0xc23d999a},
 4212 {'8', 0xa0e3bd00, 0xe4abe4e3},
 4213 {'@', 0x00000069, 0x00002133},/*        i        x-advance: 33.199219 */
 4214 {'M', 0x41177778, 0xc2b68889},
 4215 {'8', 0xd80ee800, 0xf02bf00e},
 4216 {'8', 0x102b001c, 0x280f100f},
 4217 {'8', 0x27f11600, 0x10d510f2},
 4218 {'8', 0xf0d500e4, 0xd9f2f0f2},
 4219 {'m', 0x41555556, 0x41991110},
 4220 {'l', 0x00000000, 0x42904445},
 4221 {'l', 0xc1466667, 0x00000000},
 4222 {'l', 0x00000000, 0xc2904445},
 4223 {'l', 0x41466667, 0x00000000},
 4224 {'@', 0x0000006a, 0x000020aa},/*        j        x-advance: 32.664062 */
 4225 {'M', 0x41077778, 0xc2b68889},
 4226 {'8', 0xd80ee800, 0xf02bf00e},
 4227 {'8', 0x102b001c, 0x280e100e},
 4228 {'8', 0x27f21600, 0x10d510f2},
 4229 {'8', 0xf0d500e4, 0xd9f2f0f2},
 4230 {'m', 0x3fa22220, 0x41991110},
 4231 {'4', 0x00000063, 0x02850000},
 4232 {'q', 0x00000000, 0x41a44446},
 4233 {0, 0xc196eef0, 0x41a44446},
 4234 {'9', 0x0000ffdf, 0xfff7ffc3},
 4235 {'l', 0x3d888880, 0xc11eeef0},
 4236 {'8', 0x042d0413, 0xb6430041},
 4237 {'l', 0x00000000, 0xc2a31112},
 4238 {'@', 0x0000006b, 0x00004533},/*        k        x-advance: 69.199219 */
 4239 {'M', 0x425a6667, 0x00000000},
 4240 {'l', 0xc1c80000, 0xc205ddde},
 4241 {'l', 0xc0f9999c, 0x41011110},
 4242 {'l', 0x00000000, 0x41cb3334},
 4243 {'l', 0xc1466667, 0x00000000},
 4244 {'l', 0x00000000, 0xc2ccccce},
 4245 {'l', 0x41466667, 0x00000000},
 4246 {'l', 0x00000000, 0x42777779},
 4247 {'l', 0x40d33334, 0xc0fbbbb8},
 4248 {'l', 0x41b33334, 0xc1bddde0},
 4249 {'l', 0x41711110, 0x00000000},
 4250 {'l', 0xc1e11112, 0x41f0888a},
 4251 {'l', 0x41fb3336, 0x42284445},
 4252 {'l', 0xc168888c, 0x00000000},
 4253 {'@', 0x0000006c, 0x00002133},/*        l        x-advance: 33.199219 */
 4254 {'M', 0x41b66667, 0xc2ccccce},
 4255 {'l', 0x00000000, 0x42ccccce},
 4256 {'l', 0xc1466667, 0x00000000},
 4257 {'l', 0x00000000, 0xc2ccccce},
 4258 {'l', 0x41466667, 0x00000000},
 4259 {'@', 0x0000006d, 0x000077bb},/*        m        x-advance: 119.730469 */
 4260 {'M', 0x42191112, 0xc27c4445},
 4261 {'9', 0x0000ff9f, 0x0051ff7c},
 4262 {'l', 0x00000000, 0x42537778},
 4263 {'l', 0xc1466667, 0x00000000},
 4264 {'4', 0xfdbf0000, 0x0000005d},
 4265 {'l', 0x3eaaaa80, 0x40fbbbc0},
 4266 {'q', 0x40f9999c, 0xc1133330},
 4267 {0, 0x41aaaaab, 0xc1133330},
 4268 {'8', 0x16620037, 0x4642152b},
 4269 {'8', 0xbd4ad71c, 0xe76ce72e},
 4270 {'q', 0x41399998, 0x00000000},
 4271 {0, 0x418eeef0, 0x40c66660},
 4272 {'9', 0x00310032, 0x009e0032},
 4273 {'4', 0x017b0000, 0x0000ff9d},
 4274 {'l', 0x00000000, 0xc23e2223},
 4275 {'8', 0x9edfb800, 0xe6a7e6df},
 4276 {'8', 0x23a300c5, 0x55d923de},
 4277 {'4', 0x017e0000, 0x0000ff9e},
 4278 {'l', 0x00000000, 0xc23ddddf},
 4279 {'8', 0xa0dfbd00, 0xe4a7e4df},
 4280 {'@', 0x0000006e, 0x00004b66},/*        n        x-advance: 75.398438 */
 4281 {'M', 0x421d5556, 0xc27c4445},
 4282 {'8', 0x19ad00d1, 0x42c719dc},
 4283 {'l', 0x00000000, 0x424e2223},
 4284 {'l', 0xc1455555, 0x00000000},
 4285 {'4', 0xfdbf0000, 0x0000005d},
 4286 {'l', 0x3eccccc0, 0x41100004},
 4287 {'q', 0x41033334, 0xc1255554},
 4288 {0, 0x41ac4446, 0xc1255554},
 4289 {'q', 0x41299998, 0x00000000},
 4290 {0, 0x41866666, 0x40bdddd0},
 4291 {'9', 0x002f0032, 0x009f0032},
 4292 {'4', 0x017c0000, 0x0000ff9d},
 4293 {'l', 0x00000000, 0xc23d999a},
 4294 {'8', 0xa0e3bd00, 0xe4abe4e3},
 4295 {'@', 0x0000006f, 0x00004ddd},/*        o        x-advance: 77.863281 */
 4296 {'M', 0x40c44445, 0xc2133334},
 4297 {'q', 0x00000000, 0xc17aaaac},
 4298 {0, 0x410cccce, 0xc1d11112},
 4299 {'q', 0x410cccce, 0xc1288884},
 4300 {0, 0x41bf7778, 0xc1288884},
 4301 {'q', 0x41722224, 0x00000000},
 4302 {0, 0x41bf7778, 0x41255554},
 4303 {'9', 0x00520046, 0x00cd0048},
 4304 {'l', 0x00000000, 0x400cccc0},
 4305 {'q', 0x00000000, 0x417aaaae},
 4306 {0, 0xc10ddddc, 0x41d11112},
 4307 {'q', 0xc10cccd0, 0x41277779},
 4308 {0, 0xc1bf7778, 0x41277779},
 4309 {'q', 0xc1733336, 0x34c00000},
 4310 {0, 0xc1c0888a, 0xc1277778},
 4311 {'9', 0xffadffba, 0xff2fffba},
 4312 {'6', 0xfff40000, 0x000c0062},
 4313 {'q', 0x00000000, 0x412bbbbe},
 4314 {0, 0x40a22224, 0x4194ccce},
 4315 {'q', 0x40a44444, 0x40fbbbbe},
 4316 {0, 0x4177777a, 0x40fbbbbe},
 4317 {'q', 0x41211110, 0x00000000},
 4318 {0, 0x41733334, 0xc0f7777a},
 4319 {'9', 0xffc20029, 0xff6c0029},
 4320 {'l', 0x00000000, 0xbfdddde0},
 4321 {'q', 0x00000000, 0xc1299998},
 4322 {0, 0xc0a44440, 0xc1944444},
 4323 {'q', 0xc0a44448, 0xc1000000},
 4324 {0, 0xc1766668, 0xc1000000},
 4325 {'q', 0xc1233334, 0x00000000},
 4326 {0, 0xc1755556, 0x41000000},
 4327 {'q', 0xc0a22224, 0x40fddde0},
 4328 {0, 0xc0a22224, 0x41944444},
 4329 {'l', 0x00000000, 0x3fc44440},
 4330 {'@', 0x00000070, 0x00004caa},/*        p        x-advance: 76.664062 */
 4331 {'M', 0x42295556, 0x3faaaaab},
 4332 {'9', 0x0000ff98, 0xffbeff5c},
 4333 {'l', 0x00000000, 0x420aeef0},
 4334 {'l', 0xc1466666, 0xb6000000},
 4335 {'4', 0xfce20000, 0x0000005a},
 4336 {'l', 0x3f1999a0, 0x40fddde0},
 4337 {'q', 0x40f33334, 0xc1144440},
 4338 {0, 0x41a6eeef, 0xc1144440},
 4339 {'q', 0x415aaaac, 0x00000000},
 4340 {0, 0x41a77778, 0x41222220},
 4341 {'9', 0x0051003a, 0x00d5003a},
 4342 {'l', 0x00000000, 0x3fb33320},
 4343 {'q', 0x00000000, 0x417cccd0},
 4344 {0, 0xc0eaaaa8, 0x41d1999b},
 4345 {'9', 0x0053ffc6, 0x0053ff5b},
 4346 {'m', 0xc0733330, 0xc280cccd},
 4347 {'9', 0x0000ffa7, 0x004fff7a},
 4348 {'l', 0x00000000, 0x420a2222},
 4349 {'q', 0x40b55558, 0x411ccccf},
 4350 {0, 0x41877778, 0x411ccccf},
 4351 {'q', 0x41200000, 0x00000000},
 4352 {0, 0x4169999c, 0xc0fbbbbe},
 4353 {'9', 0xffc20025, 0xff6c0025},
 4354 {'l', 0x00000000, 0xbfb33320},
 4355 {'q', 0x00000000, 0xc12bbbbc},
 4356 {0, 0xc0955558, 0xc1944446},
 4357 {'q', 0xc0933338, 0xc0fbbbb8},
 4358 {0, 0xc16bbbbc, 0xc0fbbbb8},
 4359 {'@', 0x00000071, 0x00004d99},/*        q        x-advance: 77.597656 */
 4360 {'M', 0x42866667, 0xc2904445},
 4361 {'4', 0x031e0000, 0x0000ff9d},
 4362 {'l', 0x00000000, 0xc209999a},
 4363 {'q', 0xc0ecccd0, 0x40ffffff},
 4364 {0, 0xc19eeef0, 0x40ffffff},
 4365 {'q', 0xc1555556, 0xb4000000},
 4366 {0, 0xc1a80000, 0xc1266668},
 4367 {'9', 0xffadffc4, 0xff2fffc4},
 4368 {'l', 0x00000000, 0xbfb33320},
 4369 {'q', 0x00000000, 0xc1844446},
 4370 {0, 0x40f33335, 0xc1d55556},
 4371 {'q', 0x40f33334, 0xc1222220},
 4372 {0, 0x41a91112, 0xc1222220},
 4373 {'9', 0x00000066, 0x004400a2},
 4374 {'4', 0xffc60004, 0x0000005a},
 4375 {'m', 0xc241dddf, 0x42137778},
 4376 {'q', 0x00000000, 0x412bbbbe},
 4377 {0, 0x40933334, 0x4194ccce},
 4378 {'q', 0x40955558, 0x40fbbbbe},
 4379 {0, 0x416aaaae, 0x40fbbbbe},
 4380 {'9', 0x00000058, 0xffb30086},
 4381 {'l', 0x00000000, 0xc20d999a},
 4382 {'q', 0xc0b99998, 0xc1177778},
 4383 {0, 0xc1855556, 0xc1177778},
 4384 {'q', 0xc1222222, 0x00000000},
 4385 {0, 0xc16cccce, 0x41000000},
 4386 {'q', 0xc0933334, 0x40fddde0},
 4387 {0, 0xc0933334, 0x4195ddde},
 4388 {'l', 0x00000000, 0x3faaaaa0},
 4389 {'@', 0x00000072, 0x00002e44},/*        r        x-advance: 46.265625 */
 4390 {'M', 0x4218cccd, 0xc2766667},
 4391 {'9', 0x0000ffa0, 0x0053ff7d},
 4392 {'l', 0x00000000, 0x424cccce},
 4393 {'l', 0xc1455555, 0x00000000},
 4394 {'4', 0xfdbf0000, 0x00000060},
 4395 {'l', 0x3e888880, 0x41044448},
 4396 {'q', 0x40bddde0, 0xc1199998},
 4397 {0, 0x41891112, 0xc1199998},
 4398 {'9', 0x0000001b, 0x0007002b},
 4399 {'l', 0xbd888a00, 0x4137777c},
 4400 {'q', 0xc02eeef0, 0xbf088880},
 4401 {0, 0xc0c00000, 0xbf088880},
 4402 {'[', 0x00220072, 0x00000111},/*kerning*/
 4403 {'[', 0x00270072, 0x00000111},/*kerning*/
 4404 {'[', 0x00660072, 0x00000100},/*kerning*/
 4405 {'[', 0x00740072, 0x00000355},/*kerning*/
 4406 {'[', 0x00760072, 0x00000133},/*kerning*/
 4407 {'[', 0x00770072, 0x00000122},/*kerning*/
 4408 {'[', 0x00790072, 0x00000133},/*kerning*/
 4409 {'@', 0x00000073, 0x00004677},/*        s        x-advance: 70.464844 */
 4410 {'M', 0x424d999a, 0xc1991112},
 4411 {'8', 0xc8e9e100, 0xd696e7ea},
 4412 {'q', 0xc1411112, 0xc01dddd8},
 4413 {0, 0xc199999a, 0xc0e44444},
 4414 {'q', 0xc0e44446, 0xc0977778},
 4415 {0, 0xc0e44446, 0xc15bbbbc},
 4416 {'q', 0x00000000, 0xc108888c},
 4417 {0, 0x40e8888a, 0xc16cccd0},
 4418 {'q', 0x40eaaaac, 0xc0c88880},
 4419 {0, 0x419bbbbd, 0xc0c88880},
 4420 {'q', 0x414eeef0, 0x00000000},
 4421 {0, 0x41a1999a, 0x40d33330},
 4422 {'9', 0x0034003a, 0x007f003a},
 4423 {'l', 0xc1455558, 0x00000000},
 4424 {'8', 0xbde1dd00, 0xe0a7e0e1},
 4425 {'8', 0x1aa800c3, 0x3ae61ae6},
 4426 {'8', 0x33181f00, 0x25691319},
 4427 {'q', 0x41544448, 0x40400000},
 4428 {0, 0x419ddde0, 0x40fbbbb8},
 4429 {'q', 0x40d11110, 0x409bbbc0},
 4430 {0, 0x40d11110, 0x415bbbbe},
 4431 {'q', 0x00000000, 0x41188889},
 4432 {0, 0xc0f55558, 0x41777778},
 4433 {'q', 0xc0f33330, 0x40bddddf},
 4434 {0, 0xc1a1999a, 0x40bddddf},
 4435 {'q', 0xc1655556, 0xb4000000},
 4436 {0, 0xc1af7778, 0xc0eaaaac},
 4437 {'9', 0xffc6ffc4, 0xff7effc4},
 4438 {'l', 0x41466666, 0x00000000},
 4439 {'8', 0x542e3d03, 0x165a162c},
 4440 {'8', 0xe95c003c, 0xc520e920},
 4441 {'@', 0x00000074, 0x00002caa},/*        t        x-advance: 44.664062 */
 4442 {'M', 0x421fbbbc, 0x00000000},
 4443 {'8', 0x0ab40adf, 0xdfa300ca},
 4444 {'9', 0xffdfffda, 0xff88ffda},
 4445 {'l', 0x00000000, 0xc232eef0},
 4446 {'l', 0xc1533334, 0x00000000},
 4447 {'l', 0xb4c00000, 0xc1177778},
 4448 {'l', 0x41533334, 0x00000000},
 4449 {'l', 0x00000000, 0xc18c4444},
 4450 {'l', 0x41455556, 0x00000000},
 4451 {'l', 0x00000000, 0x418c4444},
 4452 {'l', 0x41577778, 0x00000000},
 4453 {'4', 0x004b0000, 0x0000ff95},
 4454 {'l', 0x00000000, 0x42333334},
 4455 {'8', 0x38132c00, 0x0c2c0c13},
 4456 {'q', 0x40155550, 0x00000000},
 4457 {0, 0x40b99998, 0xbf4cccd0},
 4458 {'l', 0x3d888800, 0x41211112},
 4459 {'@', 0x00000075, 0x00004b44},/*        u        x-advance: 75.265625 */
 4460 {'M', 0x42588889, 0x00000000},
 4461 {'l', 0xbe888880, 0xc0e44445},
 4462 {'q', 0xc0e22220, 0x41077778},
 4463 {0, 0xc1a88888, 0x41077778},
 4464 {'q', 0xc129999c, 0xb4000000},
 4465 {0, 0xc1891112, 0xc0c88889},
 4466 {'9', 0xffceffcc, 0xff5bffcc},
 4467 {'4', 0xfe8c0000, 0x00000062},
 4468 {'l', 0x00000000, 0x423aaaac},
 4469 {'8', 0x68204d00, 0x1a491a21},
 4470 {'9', 0x0000006f, 0xffad0096},
 4471 {'l', 0x00000000, 0xc2522224},
 4472 {'l', 0x41466664, 0x00000000},
 4473 {'l', 0x00000000, 0x42904445},
 4474 {'l', 0xc13ccccc, 0x00000000},
 4475 {'@', 0x00000076, 0x00004222},/*        v        x-advance: 66.132812 */
 4476 {'M', 0x427eaaac, 0xc2904445},
 4477 {'l', 0xc1cf777a, 0x42904445},
 4478 {'l', 0xc1166666, 0x00000000},
 4479 {'l', 0xc1d11111, 0xc2904445},
 4480 {'l', 0x414aaaab, 0x00000000},
 4481 {'l', 0x4192aaaa, 0x425d1112},
 4482 {'l', 0x418eeef0, 0xc25d1112},
 4483 {'l', 0x4149999c, 0x00000000},
 4484 {'[', 0x00220076, 0x00000100},/*kerning*/
 4485 {'[', 0x00270076, 0x00000100},/*kerning*/
 4486 {'[', 0x00660076, 0x000000dd},/*kerning*/
 4487 {'@', 0x00000077, 0x00006699},/*        w        x-advance: 102.597656 */
 4488 {'M', 0x42c6cccd, 0xc2904445},
 4489 {'l', 0xc1a77778, 0x42904445},
 4490 {'l', 0xc1200000, 0x00000000},
 4491 {'l', 0xc18c4444, 0xc25a6667},
 4492 {'l', 0xc1888888, 0x425a6667},
 4493 {'l', 0xc1211112, 0x00000000},
 4494 {'l', 0xc1a77778, 0xc2904445},
 4495 {'l', 0x41455556, 0x00000000},
 4496 {'l', 0x41633334, 0x42577778},
 4497 {'l', 0x41866666, 0xc2577778},
 4498 {'l', 0x411eeef0, 0x00000000},
 4499 {'l', 0x4188888a, 0x425c0001},
 4500 {'l', 0x415eeef0, 0xc25c0001},
 4501 {'l', 0x41444440, 0x00000000},
 4502 {'@', 0x00000078, 0x000043bb},/*        x        x-advance: 67.730469 */
 4503 {'M', 0x418dddde, 0xc2904445},
 4504 {'l', 0x417cccd0, 0x41d22224},
 4505 {'l', 0x41800000, 0xc1d22224},
 4506 {'l', 0x41677774, 0x00000000},
 4507 {'l', 0xc1bccccc, 0x420e6667},
 4508 {'l', 0x41c2aaac, 0x42122223},
 4509 {'l', 0xc1644444, 0x00000000},
 4510 {'l', 0xc1855556, 0xc1d88889},
 4511 {'l', 0xc1855556, 0x41d88889},
 4512 {'l', 0xc1655557, 0x00000000},
 4513 {'l', 0x41c22222, 0xc2122223},
 4514 {'l', 0xc1bc4444, 0xc20e6667},
 4515 {'l', 0x41633334, 0x00000000},
 4516 {'@', 0x00000079, 0x00004099},/*        y        x-advance: 64.597656 */
 4517 {'M', 0x42080000, 0x41322223},
 4518 {'9', 0x0087ffcd, 0x008fff66},
 4519 {'l', 0xc0044448, 0x3d888800},
 4520 {'9', 0x0000ffe1, 0xfff8ffc9},
 4521 {'4', 0xffb00000, 0x0002001a},
 4522 {'8', 0xec4e0032, 0xb62eec1c},
 4523 {'l', 0x402aaaa8, 0xc0eaaaac},
 4524 {'l', 0xc1cdddde, 0xc28eaaab},
 4525 {'l', 0x41577778, 0x00000000},
 4526 {'l', 0x41908888, 0x42580001},
 4527 {'l', 0x4185dde0, 0xc2580001},
 4528 {'l', 0x41533334, 0x00000000},
 4529 {'l', 0xc1e7777a, 0x42a68889},
 4530 {'[', 0x00220079, 0x00000100},/*kerning*/
 4531 {'[', 0x00270079, 0x00000100},/*kerning*/
 4532 {'[', 0x00660079, 0x000000dd},/*kerning*/
 4533 {'@', 0x0000007a, 0x000043bb},/*        z        x-advance: 67.730469 */
 4534 {'M', 0x40ceeef0, 0xc277bbbd},
 4535 {'l', 0x00000000, 0xc1233334},
 4536 {'l', 0x425aeef0, 0x00000000},
 4537 {'l', 0x00000000, 0x410bbbc0},
 4538 {'l', 0xc220888a, 0x42551111},
 4539 {'l', 0x42284445, 0x35800000},
 4540 {'l', 0x00000000, 0x41222223},
 4541 {'l', 0xc264cccd, 0x00000000},
 4542 {'l', 0xb5000000, 0xc1111112},
 4543 {'l', 0x421eeeef, 0xc2537778},
 4544 {'l', 0xc21ccccd, 0xb6800000},
 4545 {'@', 0x0000007b, 0x00002e33},/*        {        x-advance: 46.199219 */
 4546 {'M', 0x40888889, 0xc210cccd},
 4547 {'l', 0x00000000, 0xc11aaaac},
 4548 {'9', 0x00000071, 0xff7f0071},
 4549 {'l', 0x00000000, 0xc1577774},
 4550 {'q', 0x00000000, 0xc1288890},
 4551 {0, 0x40a22220, 0xc1966668},
 4552 {'9', 0xffbe0028, 0xff9f0095},
 4553 {'l', 0x40266670, 0x40f33340},
 4554 {'q', 0xc0fddde0, 0x401ddde0},
 4555 {0, 0xc12eeef0, 0x410dddd8},
 4556 {'9', 0x0032ffe8, 0x0074ffe8},
 4557 {'l', 0x00000000, 0x41533330},
 4558 {'q', 0x00000000, 0x41744444},
 4559 {0, 0xc1322222, 0x41aa2222},
 4560 {'9', 0x002e0059, 0x00aa0059},
 4561 {'l', 0x00000000, 0x41511112},
 4562 {'q', 0x00000000, 0x41033334},
 4563 {0, 0x40400008, 0x4168888a},
 4564 {'9', 0x00320018, 0x00460057},
 4565 {'l', 0xc0266670, 0x40f55558},
 4566 {'q', 0xc159999a, 0xc0777778},
 4567 {0, 0xc1955556, 0xc1433334},
 4568 {'9', 0xffbeffd8, 0xff6affd8},
 4569 {'l', 0x00000000, 0xc1555556},
 4570 {'q', 0x00000000, 0xc1822222},
 4571 {0, 0xc1622224, 0xc1822222},
 4572 {'@', 0x0000007c, 0x00002155},/*        |        x-advance: 33.332031 */
 4573 {'M', 0x41ad5556, 0xc2c22223},
 4574 {'l', 0x00000000, 0x42e62223},
 4575 {'l', 0xc11eeef0, 0x00000000},
 4576 {'l', 0x00000000, 0xc2e62223},
 4577 {'l', 0x411eeef0, 0x00000000},
 4578 {'@', 0x0000007d, 0x00002e33},/*        }        x-advance: 46.199219 */
 4579 {'M', 0x42273334, 0xc2377778},
 4580 {'l', 0x00000000, 0x411aaaac},
 4581 {'9', 0x0000ff8f, 0x0081ff8f},
 4582 {'l', 0x00000000, 0x41577778},
 4583 {'q', 0x00000000, 0x41277778},
 4584 {0, 0xc0a22224, 0x41966667},
 4585 {'9', 0x0042ffd8, 0x0061ff6b},
 4586 {'l', 0xc026666a, 0xc0f55558},
 4587 {'q', 0x40fbbbbd, 0xc01ddddc},
 4588 {0, 0x412dddde, 0xc10ccccc},
 4589 {'9', 0xffce0018, 0xff8c0018},
 4590 {'l', 0x00000000, 0xc1544444},
 4591 {'q', 0x00000000, 0xc17aaaae},
 4592 {0, 0x41422223, 0xc1a91113},
 4593 {'9', 0xffd5ff9f, 0xff57ff9f},
 4594 {'l', 0x00000000, 0xc1544440},
 4595 {'q', 0x00000000, 0xc1033338},
 4596 {0, 0xc0400000, 0xc1688890},
 4597 {'9', 0xffcdffe8, 0xffbaffa9},
 4598 {'l', 0x40266669, 0xc0f33340},
 4599 {'q', 0x415aaaab, 0x40777780},
 4600 {0, 0x41955555, 0x41433338},
 4601 {'9', 0x00420028, 0x00960028},
 4602 {'l', 0x00000000, 0x41599998},
 4603 {'q', 0x00000000, 0x41800000},
 4604 {0, 0x41622224, 0x41800000},
 4605 {'@', 0x0000007e, 0x00005cdd},/*        ~        x-advance: 92.863281 */
 4606 {'M', 0x42942223, 0xc24f3334},
 4607 {'l', 0x41222220, 0xbd888800},
 4608 {'q', 0x00000000, 0x41244444},
 4609 {0, 0xc0c22220, 0x418d5556},
 4610 {'q', 0xc0c00000, 0x40eaaaa8},
 4611 {0, 0xc178888c, 0x40eaaaa8},
 4612 {'8', 0xeeae00d2, 0xcab4eedd},
 4613 {'8', 0xdacee7e5, 0xf3cff3ea},
 4614 {'8', 0x1cc100d8, 0x4eea1cea},
 4615 {'l', 0xc12bbbbc, 0x3e088880},
 4616 {'q', 0x00000000, 0xc127777a},
 4617 {0, 0x40c00002, 0xc18bbbbd},
 4618 {'q', 0x40c22222, 0xc0e00000},
 4619 {0, 0x41788889, 0xc0e00000},
 4620 {'8', 0x1351002d, 0x354b1223},
 4621 {'8', 0x2c3b2328, 0x09290913},
 4622 {'8', 0xe1420029, 0xaf19e119},
 4623 };
 4624 #define ctx_font_ascii_name "Roboto"
 4625 #endif
 4626 #endif //_CTX_INTERNAL_FONT_
 4627 #ifndef __CTX_LIST__
 4628 #define __CTX_LIST__
 4629 
 4630 #include <stdlib.h>
 4631 
 4632 #ifndef CTX_EXTERNAL_MALLOC
 4633 static inline void *ctx_realloc (void *mem, size_t old_size, size_t 
 4634                                  new_size)
 4635 {
 4636   return (void*)realloc (mem, new_size);
 4637 }
 4638 
 4639 static inline void *ctx_malloc (size_t size)
 4640 {
 4641   return (void*)malloc (size);
 4642 }
 4643 
 4644 static inline void ctx_free (void *mem)
 4645 {
 4646   free (mem);
 4647 }
 4648 
 4649 static inline void *ctx_calloc (size_t size, size_t count)
 4650 {
 4651   return calloc (size, count);
 4652 }
 4653 
 4654 #endif
 4655 
 4656 /* The whole ctx_list implementation is in the header and will be inlined
 4657  * wherever it is used.
 4658  */
 4659 struct _CtxList {
 4660   void *data;
 4661   CtxList *next;
 4662   void (*freefunc)(void *data, void *freefunc_data);
 4663   void *freefunc_data;
 4664 };
 4665 
 4666 static inline void ctx_list_prepend_full (CtxList **list, void *data,
 4667     void (*freefunc)(void *data, void *freefunc_data),
 4668     void *freefunc_data)
 4669 {
 4670   CtxList *new_= (CtxList*)ctx_calloc (sizeof (CtxList), 1);
 4671   new_->next = *list;
 4672   new_->data=data;
 4673   new_->freefunc=freefunc;
 4674   new_->freefunc_data = freefunc_data;
 4675   *list = new_;
 4676 }
 4677 
 4678 static inline int ctx_list_length (CtxList *list)
 4679 {
 4680   int length = 0;
 4681   CtxList *l;
 4682   for (l = list; l; l = l->next, length++);
 4683   return length;
 4684 }
 4685 
 4686 static inline void ctx_list_prepend (CtxList **list, void *data)
 4687 {
 4688   CtxList *new_ = (CtxList*) ctx_calloc (sizeof (CtxList), 1);
 4689   new_->next= *list;
 4690   new_->data=data;
 4691   *list = new_;
 4692 }
 4693 
 4694 static inline CtxList *ctx_list_nth (CtxList *list, int no)
 4695 {
 4696   while (no-- && list)
 4697     { list = list->next; }
 4698   return list;
 4699 }
 4700 
 4701 static inline void *ctx_list_nth_data (CtxList *list, int no)
 4702 {
 4703   CtxList *l = ctx_list_nth (list, no);
 4704   if (l)
 4705     return l->data;
 4706   return NULL;
 4707 }
 4708 
 4709 
 4710 static inline void
 4711 ctx_list_insert_before (CtxList **list, CtxList *sibling,
 4712                        void *data)
 4713 {
 4714   if (*list == NULL || *list == sibling)
 4715     {
 4716       ctx_list_prepend (list, data);
 4717     }
 4718   else
 4719     {
 4720       CtxList *prev = NULL;
 4721       for (CtxList *l = *list; l; l=l->next)
 4722         {
 4723           if (l == sibling)
 4724             { break; }
 4725           prev = l;
 4726         }
 4727       if (prev)
 4728         {
 4729           CtxList *new_ = (CtxList*)ctx_calloc (sizeof (CtxList), 1);
 4730           new_->next = sibling;
 4731           new_->data = data;
 4732           prev->next=new_;
 4733         }
 4734     }
 4735 }
 4736 
 4737 static inline void ctx_list_remove_link (CtxList **list, CtxList *link)
 4738 {
 4739   CtxList *iter, *prev = NULL;
 4740   if ((*list) == link)
 4741     {
 4742       prev = (*list)->next;
 4743       *list = prev;
 4744       link->next = NULL;
 4745       return;
 4746     }
 4747   for (iter = *list; iter; iter = iter->next)
 4748     if (iter == link)
 4749       {
 4750         if (prev)
 4751           prev->next = iter->next;
 4752         link->next = NULL;
 4753         return;
 4754       }
 4755     else
 4756       prev = iter;
 4757 }
 4758 
 4759 static inline void ctx_list_remove (CtxList **list, void *data)
 4760 {
 4761   CtxList *iter, *prev = NULL;
 4762   if ((*list)->data == data)
 4763     {
 4764       if ((*list)->freefunc)
 4765         (*list)->freefunc ((*list)->data, (*list)->freefunc_data);
 4766       prev = (*list)->next;
 4767       ctx_free (*list);
 4768       *list = prev;
 4769       return;
 4770     }
 4771   for (iter = *list; iter; iter = iter->next)
 4772     if (iter->data == data)
 4773       {
 4774         if (iter->freefunc)
 4775           iter->freefunc (iter->data, iter->freefunc_data);
 4776         prev->next = iter->next;
 4777         ctx_free (iter);
 4778         break;
 4779       }
 4780     else
 4781       prev = iter;
 4782 }
 4783 
 4784 static inline void ctx_list_free (CtxList **list)
 4785 {
 4786   while (*list)
 4787     ctx_list_remove (list, (*list)->data);
 4788 }
 4789 
 4790 static inline void
 4791 ctx_list_reverse (CtxList **list)
 4792 {
 4793   CtxList *new_ = NULL;
 4794   CtxList *l;
 4795   for (l = *list; l; l=l->next)
 4796     ctx_list_prepend (&new_, l->data);
 4797   ctx_list_free (list);
 4798   *list = new_;
 4799 }
 4800 
 4801 static inline void *ctx_list_last (CtxList *list)
 4802 {
 4803   if (list)
 4804     {
 4805       CtxList *last;
 4806       for (last = list; last->next; last=last->next);
 4807       return last->data;
 4808     }
 4809   return NULL;
 4810 }
 4811 
 4812 static inline void ctx_list_concat (CtxList **list, CtxList *list_b)
 4813 {
 4814   if (*list)
 4815     {
 4816       CtxList *last;
 4817       for (last = *list; last->next; last=last->next);
 4818       last->next = list_b;
 4819       return;
 4820     }
 4821   *list = list_b;
 4822 }
 4823 
 4824 static inline void ctx_list_append_full (CtxList **list, void *data,
 4825     void (*freefunc)(void *data, void *freefunc_data),
 4826     void *freefunc_data)
 4827 {
 4828   CtxList *new_ = (CtxList*) ctx_calloc (sizeof (CtxList), 1);
 4829   new_->data=data;
 4830   new_->freefunc = freefunc;
 4831   new_->freefunc_data = freefunc_data;
 4832   ctx_list_concat (list, new_);
 4833 }
 4834 
 4835 static inline void ctx_list_append (CtxList **list, void *data)
 4836 {
 4837   ctx_list_append_full (list, data, NULL, NULL);
 4838 }
 4839 
 4840 static inline void
 4841 ctx_list_insert_at (CtxList **list,
 4842                     int       no,
 4843                     void     *data)
 4844 {
 4845   if (*list == NULL || no == 0)
 4846     {
 4847       ctx_list_prepend (list, data);
 4848     }
 4849   else
 4850     {
 4851       int pos = 0;
 4852       CtxList *prev = NULL;
 4853       CtxList *sibling = NULL;
 4854       for (CtxList *l = *list; l && pos < no; l=l->next)
 4855         {
 4856           prev = sibling;
 4857           sibling = l;
 4858           pos ++;
 4859         }
 4860       if (prev)
 4861         {
 4862           CtxList *new_ = (CtxList*)ctx_calloc (sizeof (CtxList), 1);
 4863           new_->next = sibling;
 4864           new_->data = data;
 4865           prev->next=new_;
 4866           return;
 4867         }
 4868       ctx_list_append (list, data);
 4869     }
 4870 }
 4871 
 4872 static CtxList*
 4873 ctx_list_merge_sorted (CtxList* list1,
 4874                        CtxList* list2,
 4875     int(*compare)(const void *a, const void *b, void *userdata), void 
 4876         *userdata
 4877 )
 4878 {
 4879   if (list1 == NULL)
 4880      return(list2);
 4881   else if (list2==NULL)
 4882      return(list1);
 4883 
 4884   if (compare (list1->data, list2->data, userdata) >= 0)
 4885   {
 4886     list1->next = ctx_list_merge_sorted (list1->next,list2, compare, 
 4887                   userdata);
 4888     /*list1->next->prev = list1;
 4889       list1->prev = NULL;*/
 4890     return list1;
 4891   }
 4892   else
 4893   {
 4894     list2->next = ctx_list_merge_sorted (list1,list2->next, compare, 
 4895                   userdata);
 4896     /*list2->next->prev = list2;
 4897       list2->prev = NULL;*/
 4898     return list2;
 4899   }
 4900 }
 4901 
 4902 static void
 4903 ctx_list_split_half (CtxList*  head,
 4904                      CtxList** list1,
 4905                      CtxList** list2)
 4906 {
 4907   CtxList* fast;
 4908   CtxList* slow;
 4909   if (head==NULL || head->next==NULL)
 4910   {
 4911     *list1 = head;
 4912     *list2 = NULL;
 4913   }
 4914   else
 4915   {
 4916     slow = head;
 4917     fast = head->next;
 4918 
 4919     while (fast != NULL)
 4920     {
 4921       fast = fast->next;
 4922       if (fast != NULL)
 4923       {
 4924         slow = slow->next;
 4925         fast = fast->next;
 4926       }
 4927     }
 4928 
 4929     *list1 = head;
 4930     *list2 = slow->next;
 4931     slow->next = NULL;
 4932   }
 4933 }
 4934 
 4935 static inline void ctx_list_sort (CtxList **head,
 4936     int(*compare)(const void *a, const void *b, void *userdata),
 4937     void *userdata)
 4938 {
 4939   CtxList* list1;
 4940   CtxList* list2;
 4941 
 4942   /* Base case -- length 0 or 1 */
 4943   if ((*head == NULL) || ((*head)->next == NULL))
 4944   {
 4945     return;
 4946   }
 4947 
 4948   ctx_list_split_half (*head, &list1, &list2);
 4949   ctx_list_sort (&list1, compare, userdata);
 4950   ctx_list_sort (&list2, compare, userdata);
 4951   *head = ctx_list_merge_sorted (list1, list2, compare, userdata);
 4952 }
 4953 
 4954 static inline void ctx_list_insert_sorted (CtxList **list,
 4955                                            void     *item,
 4956     int(*compare)(const void *a, const void *b, void *userdata),
 4957                                            void     *userdata)
 4958 {
 4959   ctx_list_prepend (list, item);
 4960   ctx_list_sort (list, compare, userdata);
 4961 }
 4962 
 4963 
 4964 static inline CtxList *ctx_list_find_custom (CtxList *list,
 4965                                          void    *needle,
 4966                                          int(*compare)(const void *a, const 
 4967                                              void *b),
 4968                                          void *userdata)
 4969 {
 4970   CtxList *l;
 4971   for (l = list; l; l = l->next)
 4972   {
 4973     if (compare (l->data, needle) == 0)
 4974       return l;
 4975   }
 4976   return NULL;
 4977 }
 4978 
 4979 #endif
 4980 /* definitions that determine which features are included and their 
 4981 settings,
 4982  * for particular platforms - in particular microcontrollers ctx might need
 4983  * tuning for different quality/performance/resource constraints.
 4984  *
 4985  * the way to configure ctx is to set these defines, before both including 
 4986  it
 4987  * as a header and in the file where CTX_IMPLEMENTATION is set to include 
 4988  the
 4989  * implementation for different featureset and runtime settings.
 4990  *
 4991  */
 4992 
 4993 /* whether the font rendering happens in backend or front-end of API, the
 4994  * option is used set to 0 by the tool that converts ttf fonts to ctx 
 4995  internal
 4996  * representation - both should be possible so that this tool can be made
 4997  * into a TTF/OTF font import at runtime (perhaps even with live subsetting)
 4998                                           .
 4999  *
 5000  * improving this feature and making it runtime selectable could also
 5001  * be part of encoding all text as beziers upon pdf export
 5002  */
 5003 #ifndef CTX_BACKEND_TEXT
 5004 #define CTX_BACKEND_TEXT 1
 5005 #endif
 5006 
 5007 
 5008 #define CTX_RASTERIZER_AA_SLOPE_LIMIT3           (65536/CTX_SUBDIV/15)
 5009 #define CTX_RASTERIZER_AA_SLOPE_LIMIT3_FAST_AA   (65536/CTX_SUBDIV/15)
 5010 //#define CTX_RASTERIZER_AA_SLOPE_LIMIT3_FAST_AA (120536/CTX_SUBDIV/15)
 5011 //#define CTX_RASTERIZER_AA_SLOPE_LIMIT3_FAST_AA (105000/CTX_SUBDIV/15)
 5012 #define CTX_RASTERIZER_AA_SLOPE_LIMIT5           (140425/CTX_SUBDIV/15)
 5013 #define CTX_RASTERIZER_AA_SLOPE_LIMIT15          (260425/CTX_SUBDIV/15)
 5014 
 5015 /* subpixel-aa coordinates used in BITPACKing of drawlist
 5016  *
 5017  * powers of 2 is faster
 5018  */
 5019 #ifndef CTX_SUBDIV
 5020 #define CTX_SUBDIV   8  //  max framebufer width 4095
 5021 //#define CTX_SUBDIV  10  //  max framebufer width 3250
 5022 //#define CTX_SUBDIV  16  //  max framebufer width 2047
 5023 //#define CTX_SUBDIV  24  //  max framebufer width 1350
 5024 //#define CTX_SUBDIV  32  //  max framebufer width 1023
 5025 #endif
 5026 
 5027 
 5028 // 8    12 68 40 24
 5029 // 16   12 68 40 24
 5030 /* scale-factor for font outlines prior to bit quantization by CTX_SUBDIV
 5031  *
 5032  * changing this also changes font file format - the value should be baked
 5033  * into the ctxf files making them less dependent on the ctx used to
 5034  * generate them
 5035  */
 5036 #define CTX_BAKE_FONT_SIZE    160
 5037 
 5038 /* pack some linetos/curvetos/movetos into denser drawlist instructions,
 5039  * permitting more vectors to be stored in the same space, experimental
 5040  * feature with added overhead.
 5041  */
 5042 #ifndef CTX_BITPACK
 5043 #define CTX_BITPACK           1
 5044 #endif
 5045 
 5046 /* whether we have a shape-cache where we keep pre-rasterized bitmaps of
 5047  * commonly occuring small shapes, disabled by default since it has some
 5048  * glitches (and potential hangs with multi threading).
 5049  */
 5050 #ifndef CTX_SHAPE_CACHE
 5051 #define CTX_SHAPE_CACHE        0
 5052 #endif
 5053 
 5054 
 5055 #ifndef CTX_SHAPE_CACHE_DEFAULT // the default set runtime value
 5056                                 // when enabled
 5057 #define CTX_SHAPE_CACHE_DEFAULT   0
 5058 #endif
 5059 
 5060 /* size (in pixels, w*h) that we cache rasterization for
 5061  */
 5062 #ifndef CTX_SHAPE_CACHE_DIM
 5063 #define CTX_SHAPE_CACHE_DIM      (64*64)
 5064 #endif
 5065 
 5066 #ifndef CTX_SHAPE_CACHE_MAX_DIM
 5067 #define CTX_SHAPE_CACHE_MAX_DIM  256
 5068 #endif
 5069 
 5070 /* maximum number of entries in shape cache
 5071  */
 5072 #ifndef CTX_SHAPE_CACHE_ENTRIES
 5073 #define CTX_SHAPE_CACHE_ENTRIES  1024
 5074 #endif
 5075 
 5076 
 5077 #ifndef CTX_PARSER_FIXED_TEMP
 5078 #define CTX_PARSER_FIXED_TEMP 0
 5079          // when 1  CTX_PARSER_MAXLEN is the fixed max stringlen
 5080 #endif   // and no allocations happens beyond creating the parser,
 5081          // when 0 the scratchbuf for parsing is a separate dynamically
 5082          // growing buffer, that maxes out at CTX_PARSER_MAXLEN
 5083          //
 5084 #ifndef CTX_PARSER_MAXLEN
 5085 #if CTX_PARSER_FIXED_TEMP
 5086 #define CTX_PARSER_MAXLEN  1024*128        // This is the maximum 
 5087 texture/string size supported
 5088 #else
 5089 #define CTX_PARSER_MAXLEN  1024*1024*16    // 16mb
 5090 #endif
 5091 #endif
 5092 
 5093 
 5094 #ifndef CTX_FAST_FILL_RECT
 5095 #define CTX_FAST_FILL_RECT 1    /*  matters most for tiny rectangles where 
 5096 it shaves overhead, for larger rectangles
 5097                                     a ~15-20% performance win can be seen. 
 5098                                     */
 5099 #endif
 5100 
 5101 
 5102 #ifndef CTX_COMPOSITING_GROUPS
 5103 #define CTX_COMPOSITING_GROUPS   1
 5104 #endif
 5105 
 5106 /* maximum nesting level of compositing groups
 5107  */
 5108 #ifndef CTX_GROUP_MAX
 5109 #define CTX_GROUP_MAX             8
 5110 #endif
 5111 
 5112 #ifndef CTX_ENABLE_CLIP
 5113 #define CTX_ENABLE_CLIP           1
 5114 #endif
 5115 
 5116 /* use a 1bit clip buffer, saving RAM on microcontrollers, other rendering
 5117  * will still be antialiased.
 5118  */
 5119 #ifndef CTX_1BIT_CLIP
 5120 #define CTX_1BIT_CLIP             0
 5121 #endif
 5122 
 5123 
 5124 #ifndef CTX_ENABLE_SHADOW_BLUR
 5125 #define CTX_ENABLE_SHADOW_BLUR    0
 5126 #endif
 5127 
 5128 #ifndef CTX_GRADIENTS
 5129 #define CTX_GRADIENTS             1
 5130 #endif
 5131 
 5132 #ifndef CTX_ALIGNED_STRUCTS
 5133 #define CTX_ALIGNED_STRUCTS       1
 5134 #endif
 5135 
 5136 #ifndef CTX_GRADIENT_CACHE
 5137 #define CTX_GRADIENT_CACHE        1
 5138 #endif
 5139 
 5140 #ifndef CTX_FONTS_FROM_FILE
 5141 #define CTX_FONTS_FROM_FILE  0
 5142 #endif
 5143 
 5144 #ifndef CTX_GET_CONTENTS
 5145 #if CTX_FONTS_FROM_FILE
 5146 #define CTX_GET_CONTENTS    1
 5147 #else
 5148 #define CTX_GET_CONTENTS    0
 5149 #endif
 5150 #endif
 5151 
 5152 #ifndef CTX_FORMATTER
 5153 #define CTX_FORMATTER       1
 5154 #endif
 5155 
 5156 #ifndef CTX_PARSER
 5157 #define CTX_PARSER          1
 5158 #endif
 5159 
 5160 #ifndef CTX_CURRENT_PATH
 5161 #define CTX_CURRENT_PATH    1
 5162 #endif
 5163 
 5164 #ifndef CTX_XML
 5165 #define CTX_XML             1
 5166 #endif
 5167 
 5168 #ifndef CTX_CLIENTS
 5169 #define CTX_CLIENTS              0
 5170 #endif
 5171 
 5172 /* when ctx_math is defined, which it is by default, we use ctx' own
 5173  * implementations of math functions, instead of relying on math.h
 5174  * the possible inlining gives us a slight speed-gain, and on
 5175  * embedded platforms guarantees that we do not do double precision
 5176  * math.
 5177  */
 5178 #ifndef CTX_MATH
 5179 #define CTX_MATH           1  // use internal fast math for sqrt,sin,cos,
 5180 atan2f etc.
 5181 #endif
 5182 
 5183 #define ctx_log(fmt, ...)
 5184 //#define ctx_log(str, a...) fprintf(stderr, str, ##a)
 5185 
 5186 /* the initial journal size - for both rasterizer
 5187  * edgelist and drawlist.
 5188  */
 5189 #ifndef CTX_MIN_JOURNAL_SIZE
 5190 #define CTX_MIN_JOURNAL_SIZE      512
 5191 #endif
 5192 
 5193 /* The maximum size we permit the drawlist to grow to,
 5194  * the memory used is this number * 9, where 9 is sizeof(CtxEntry)
 5195  */
 5196 #ifndef CTX_MAX_JOURNAL_SIZE
 5197 //#define CTX_MAX_JOURNAL_SIZE   CTX_MIN_JOURNAL_SIZE
 5198 #define CTX_MAX_JOURNAL_SIZE 1024*1024*8
 5199 #endif
 5200 
 5201 #ifndef CTX_DRAWLIST_STATIC
 5202 #define CTX_DRAWLIST_STATIC  0
 5203 #endif
 5204 
 5205 #ifndef CTX_MIN_EDGE_LIST_SIZE
 5206 #define CTX_MIN_EDGE_LIST_SIZE   2048*2
 5207 #endif
 5208 
 5209 #ifndef CTX_RASTERIZER_AA
 5210 #define CTX_RASTERIZER_AA 15   // vertical-AA of CTX_ANTIALIAS_DEFAULT
 5211 #endif
 5212 
 5213 /* The maximum complexity of a single path
 5214  */
 5215 #ifndef CTX_MAX_EDGE_LIST_SIZE
 5216 #define CTX_MAX_EDGE_LIST_SIZE  CTX_MIN_EDGE_LIST_SIZE
 5217 #endif
 5218 
 5219 #ifndef CTX_MAX_KEYDB
 5220 #define CTX_MAX_KEYDB 64 // number of entries in keydb
 5221                          // entries are "copy-on-change" between states
 5222 #endif
 5223 
 5224 #ifndef CTX_STRINGPOOL_SIZE
 5225   // XXX should be possible to make zero and disappear when codepaths not 
 5226   in use
 5227   //     to save size, for card10 this is defined as a low number (some 
 5228                                                                    text
 5229   //     properties still make use of it)
 5230   //     
 5231   //     for desktop-use this should be fully dynamic, possibly
 5232   //     with chained pools, gradients are stored here.
 5233 #define CTX_STRINGPOOL_SIZE     1000 //
 5234 #endif
 5235 
 5236 #ifndef CTX_32BIT_SEGMENTS
 5237 #define CTX_32BIT_SEGMENTS 1  // without this clipping problems might
 5238                               // occur when drawing far outside the 
 5239                               viewport
 5240                               // or with large translate amounts
 5241                               // on micro controllers you most often will
 5242                               // want this set to 0
 5243 #endif
 5244 
 5245 /* whether we dither or not for gradients
 5246  */
 5247 #ifndef CTX_DITHER
 5248 #define CTX_DITHER 0
 5249 #endif
 5250 
 5251 /*  only source-over clear and copy will work, the API still
 5252  *  through - but the backend is limited, for use to measure
 5253  *  size and possibly in severely constrained ROMs.
 5254  */
 5255 #ifndef CTX_BLENDING_AND_COMPOSITING
 5256 #define CTX_BLENDING_AND_COMPOSITING 1
 5257 #endif
 5258 
 5259 /*  this forces the inlining of some performance
 5260  *  critical paths.
 5261  */
 5262 #ifndef CTX_FORCE_INLINES
 5263 #define CTX_FORCE_INLINES               1
 5264 #endif
 5265 
 5266 /* create one-off inlined inner loop for normal blend mode (for floating 
 5267                                                             point,
 5268  * and grayscale for RGBA8 manual loops overrrides. Disabling this should 
 5269  speed
 5270  * up compiles at penalty for the given formats.
 5271  */
 5272 #ifndef CTX_INLINED_NORMAL     
 5273 #define CTX_INLINED_NORMAL      0
 5274 #endif
 5275 
 5276 /*
 5277  *  do not use manual RGBA8 code but rely on ctx inline templating
 5278  */
 5279 #ifndef CTX_INLINED_NORMAL     
 5280 #define CTX_INLINED_NORMAL_RGBA8  0
 5281 #endif
 5282 
 5283 #ifndef CTX_RASTERIZER_SWITCH_DISPATCH
 5284 #define CTX_RASTERIZER_SWITCH_DISPATCH  1 // marginal improvement for some
 5285                                           // modes, maybe get rid of this?
 5286 #endif
 5287 
 5288 #ifndef CTX_U8_TO_FLOAT_LUT
 5289 #define CTX_U8_TO_FLOAT_LUT  0
 5290 #endif
 5291 
 5292 #ifndef CTX_INLINED_GRADIENTS
 5293 #define CTX_INLINED_GRADIENTS   1
 5294 #endif
 5295 
 5296 #ifndef CTX_BRAILLE_TEXT
 5297 #define CTX_BRAILLE_TEXT        0
 5298 #endif
 5299 
 5300 /* Build code paths for grayscale rasterization, this makes clipping
 5301  * faster.
 5302  */
 5303 #ifndef CTX_NATIVE_GRAYA8
 5304 #define CTX_NATIVE_GRAYA8       1
 5305 #endif
 5306 
 5307 /* enable CMYK rasterization targets
 5308  */
 5309 #ifndef CTX_ENABLE_CMYK
 5310 #define CTX_ENABLE_CMYK         1
 5311 #endif
 5312 
 5313 /* enable color management, slightly increases CtxColor struct size, can
 5314  * be disabled for microcontrollers.
 5315  */
 5316 #ifndef CTX_ENABLE_CM
 5317 #define CTX_ENABLE_CM           1
 5318 #endif
 5319 
 5320 #ifndef CTX_EVENTS
 5321 #define CTX_EVENTS              1
 5322 #endif
 5323 
 5324 #ifndef CTX_AVOID_CLIPPED_SUBDIVISION
 5325 #define CTX_AVOID_CLIPPED_SUBDIVISION 0
 5326 #endif
 5327 
 5328 #ifndef CTX_MAX_DEVICES
 5329 #define CTX_MAX_DEVICES 16
 5330 #endif
 5331 
 5332 #ifndef CTX_MAX_KEYBINDINGS
 5333 #define CTX_MAX_KEYBINDINGS 256
 5334 #endif
 5335 
 5336 
 5337 #ifndef CTX_PROTOCOL_U8_COLOR
 5338 #define CTX_PROTOCOL_U8_COLOR 0
 5339 #endif
 5340 
 5341 #ifndef CTX_TERMINAL_EVENTS
 5342 #if CTX_EVENTS
 5343 #define CTX_TERMINAL_EVENTS 1
 5344 #else
 5345 #define CTX_TERMINAL_EVENTS 0
 5346 #endif
 5347 #endif
 5348 
 5349 #ifndef CTX_LIMIT_FORMATS
 5350 #define CTX_LIMIT_FORMATS       0
 5351 #endif
 5352 
 5353 #ifndef CTX_ENABLE_FLOAT
 5354 #define CTX_ENABLE_FLOAT        0
 5355 #endif
 5356 
 5357 /* by default ctx includes all pixel formats, on microcontrollers
 5358  * it can be useful to slim down code and runtime size by only
 5359  * defining the used formats, set CTX_LIMIT_FORMATS to 1, and
 5360  * manually add CTX_ENABLE_ flags for each of them.
 5361  */
 5362 #if CTX_LIMIT_FORMATS
 5363 #if CTX_NATIVE_GRAYA8
 5364 #define CTX_ENABLE_GRAYA8               1
 5365 #define CTX_ENABLE_GRAY8                1
 5366 #endif
 5367 #else
 5368 
 5369 #define CTX_ENABLE_GRAY1                1
 5370 #define CTX_ENABLE_GRAY2                1
 5371 #define CTX_ENABLE_GRAY4                1
 5372 #define CTX_ENABLE_GRAY8                1
 5373 #define CTX_ENABLE_GRAYA8               1
 5374 #define CTX_ENABLE_GRAYF                1
 5375 #define CTX_ENABLE_GRAYAF               1
 5376 
 5377 #define CTX_ENABLE_RGB8                 1
 5378 #define CTX_ENABLE_RGBA8                1
 5379 #define CTX_ENABLE_BGRA8                1
 5380 #define CTX_ENABLE_RGB332               1
 5381 #define CTX_ENABLE_RGB565               1
 5382 #define CTX_ENABLE_RGB565_BYTESWAPPED   1
 5383 #define CTX_ENABLE_RGBAF                1
 5384 #ifdef CTX_ENABLE_FLOAT
 5385 #undef CTX_ENABLE_FLOAT
 5386 #endif
 5387 #define CTX_ENABLE_FLOAT                1
 5388 #define CTX_ENABLE_YUV420               1
 5389 
 5390 #if CTX_ENABLE_CMYK
 5391 #define CTX_ENABLE_CMYK8                1
 5392 #define CTX_ENABLE_CMYKA8               1
 5393 #define CTX_ENABLE_CMYKAF               1
 5394 #endif
 5395 #endif
 5396 
 5397 #ifndef CTX_RGB565_ALPHA
 5398 #define CTX_RGB565_ALPHA                0   // when enabled pure purple is 
 5399 transparent,
 5400                                             // for a ~15% overall 
 5401                                             performance hit
 5402 #endif
 5403 
 5404 #ifndef CTX_RGB332_ALPHA
 5405 #define CTX_RGB332_ALPHA                0   // when enabled pure purple is 
 5406 transparent,
 5407                                             // for a ~15% overall 
 5408                                             performance hit
 5409 #endif
 5410 
 5411 
 5412 /* by including ctx-font-regular.h, or ctx-font-mono.h the
 5413  * built-in fonts using ctx drawlist encoding is enabled
 5414  */
 5415 #ifndef CTX_NO_FONTS
 5416 #ifndef CTX_FONT_ENGINE_CTX
 5417 #define CTX_FONT_ENGINE_CTX        1
 5418 #endif
 5419 #endif
 5420 
 5421 #ifndef CTX_ONE_FONT_ENGINE
 5422 #define CTX_ONE_FONT_ENGINE 0
 5423 #endif
 5424 
 5425 
 5426 #ifndef CTX_FONT_ENGINE_CTX_FS
 5427 #define CTX_FONT_ENGINE_CTX_FS 0
 5428 #endif
 5429 
 5430 /* If stb_strutype.h is included before ctx.h add integration code for 
 5431 runtime loading
 5432  * of opentype fonts.
 5433  */
 5434 #ifdef __STB_INCLUDE_STB_TRUETYPE_H__
 5435 #ifndef CTX_FONT_ENGINE_STB
 5436 #define CTX_FONT_ENGINE_STB        1
 5437 #endif
 5438 #else
 5439 #define CTX_FONT_ENGINE_STB        0
 5440 #endif
 5441 
 5442 #ifndef CTX_BABL
 5443 #ifdef _BABL_H
 5444 #define CTX_BABL 1
 5445 #else
 5446 #define CTX_BABL 0
 5447 #endif
 5448 #endif
 5449 
 5450 #ifndef _BABL_H
 5451 #undef CTX_BABL
 5452 #define CTX_BABL 0
 5453 #endif
 5454 
 5455 #ifndef CTX_ALWAYS_USE_NEAREST_FOR_SCALE1
 5456 #define CTX_ALWAYS_USE_NEAREST_FOR_SCALE1 0
 5457 #endif
 5458 
 5459 /* force add format if we have shape cache */
 5460 #if CTX_SHAPE_CACHE
 5461 #ifdef CTX_ENABLE_GRAY8
 5462 #undef CTX_ENABLE_GRAY8
 5463 #endif
 5464 #define CTX_ENABLE_GRAY8  1
 5465 #endif
 5466 
 5467 /* include the bitpack packer, can be opted out of to decrease code size
 5468  */
 5469 #ifndef CTX_BITPACK_PACKER
 5470 #define CTX_BITPACK_PACKER 0
 5471 #endif
 5472 
 5473 /* enable RGBA8 intermediate format for
 5474  *the indirectly implemented pixel-formats.
 5475  */
 5476 #if CTX_ENABLE_GRAY1 | CTX_ENABLE_GRAY2 | CTX_ENABLE_GRAY4 | 
 5477 CTX_ENABLE_RGB565 | CTX_ENABLE_RGB565_BYTESWAPPED | CTX_ENABLE_RGB8 | 
 5478 CTX_ENABLE_RGB332
 5479 
 5480   #ifdef CTX_ENABLE_RGBA8
 5481     #undef CTX_ENABLE_RGBA8
 5482   #endif
 5483   #define CTX_ENABLE_RGBA8  1
 5484 #endif
 5485 
 5486 #ifdef CTX_ENABLE_CMYKF
 5487 #ifdef CTX_ENABLE_FLOAT
 5488 #undef CTX_ENABLE_FLOAT
 5489 #endif
 5490 #define CTX_ENABLE_FLOAT 1
 5491 #endif
 5492 
 5493 #ifdef CTX_ENABLE_GRAYF
 5494 #ifdef CTX_ENABLE_FLOAT
 5495 #undef CTX_ENABLE_FLOAT
 5496 #endif
 5497 #define CTX_ENABLE_FLOAT 1
 5498 #endif
 5499 
 5500 #ifdef CTX_ENABLE_GRAYAF
 5501 #ifdef CTX_ENABLE_FLOAT
 5502 #undef CTX_ENABLE_FLOAT