"Fossies" - the Fresh Open Source Software Archive

Member "gambas-3.16.3/gb.gtk/src/gfont.cpp" (7 Sep 2021, 16158 Bytes) of package /linux/misc/gambas-3.16.3.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "gfont.cpp" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 3.16.2_vs_3.16.3.

    1 /***************************************************************************
    2 
    3     gfont.cpp
    4 
    5     (c) 2004-2006 - Daniel Campos Fernández <dcamposf@gmail.com>
    6 
    7     This program is free software; you can redistribute it and/or modify
    8     it under the terms of the GNU General Public License as published by
    9     the Free Software Foundation; either version 2, or (at your option)
   10     any later version.
   11 
   12     This program is distributed in the hope that it will be useful,
   13     but WITHOUT ANY WARRANTY; without even the implied warranty of
   14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   15     GNU General Public License for more details.
   16 
   17     You should have received a copy of the GNU General Public License
   18     along with this program; if not, write to the Free Software
   19     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
   20     MA 02110-1301, USA.
   21 
   22 ***************************************************************************/
   23 
   24 #include "widgets.h"
   25 #include "font-parser.h"
   26 #include "gdesktop.h"
   27 #include "gtools.h"
   28 #include "gb.form.font.h"
   29 
   30 #include <math.h>
   31 
   32 static int count_newlines(const char *str, int len)
   33 {
   34     int i, n;
   35     
   36     for (i = 0, n = 0; i < len; i++)
   37     {
   38         if (str[i] == '\n')
   39             n++;
   40     }
   41     return n;
   42 }
   43 
   44 static void set_font_from_string(gFont *font, const char *str)
   45 {
   46     gchar **tokens, **p;
   47     gchar *copy, *elt;
   48     int grade;
   49     double size;
   50     int len;
   51     
   52     if (!str || !*str)
   53         return;
   54         
   55     tokens = g_strsplit(str, ",", 0);
   56     
   57     p = tokens;
   58     for(p = tokens; *p; p++)
   59     {
   60         copy = g_strdup(*p);
   61         elt = g_strstrip(copy);
   62         
   63         if (!strcasecmp(elt, "bold"))
   64             font->setBold(true);
   65         else if (!strcasecmp(elt, "italic"))
   66             font->setItalic(true);
   67         else if (!strcasecmp(elt, "underline"))
   68             font->setUnderline(true);
   69         else if (!strcasecmp(elt, "strikeout"))
   70             font->setStrikeout(true);
   71         else if (elt[0] == '+' || elt[0] == '-' || elt[0] == '0')
   72         {
   73             grade = atoi(elt);
   74             if (grade || elt[0] == '0')
   75                 font->setGrade(grade);
   76         }
   77         else
   78         {
   79             size = atof(elt);
   80             if (isdigit(*elt) && size != 0.0)
   81                 font->setSize(size);
   82             else
   83             {
   84                 font->setBold(false);
   85                 font->setItalic(false);
   86                 font->setUnderline(false);
   87                 font->setStrikeout(false);
   88                 
   89                 len = strlen(elt);
   90                 if (len > 2 && elt[0] == '"' && elt[len - 1] == '"')
   91                 {
   92                     elt[len - 1] = 0;
   93                     elt++;
   94                 }
   95                 font->setName(elt);
   96             }
   97         }
   98 
   99         g_free(copy);
  100     }
  101     
  102     g_strfreev(tokens);
  103 }
  104 
  105 
  106 //-------------------------------------------------------------------------
  107 
  108 static int FONT_n_families;
  109 GList *FONT_families = NULL;
  110 
  111 static int _nfont = 0;
  112 
  113 void gFont::init()
  114 {
  115     PangoFontFamily **_families;
  116     PangoContext *ct;
  117     char *buf1,*buf2; 
  118     int bucle;
  119 
  120     ct = gdk_pango_context_get();
  121     pango_context_list_families(ct, &_families, &FONT_n_families);
  122     
  123     for (bucle = 0; bucle<FONT_n_families; bucle++)
  124     {
  125         buf1 = (char *)pango_font_family_get_name(_families[bucle]);
  126         if (buf1)
  127         {
  128             buf2 = (char *)g_malloc(sizeof(char)*(strlen(buf1)+1));
  129             strcpy(buf2,buf1);
  130             FONT_families = g_list_prepend (FONT_families,buf2);
  131         }
  132     }
  133     
  134     if (FONT_families)
  135         FONT_families = g_list_sort(FONT_families, (GCompareFunc)strcasecmp);
  136     
  137     g_free(_families);
  138     g_object_unref(G_OBJECT(ct));
  139 }
  140 
  141 void gFont::exit()
  142 {
  143     GList *iter;
  144     
  145     iter = FONT_families;
  146     
  147     if (iter)
  148     {
  149         iter = g_list_first(iter);
  150         while (iter)
  151         {
  152             g_free(iter->data);
  153             iter=iter->next;
  154         }
  155     }
  156     
  157     if (FONT_families) g_list_free(FONT_families);
  158     
  159     //if (_nfont)
  160     //  fprintf(stderr, "WARNING: %d gFont objects were not freed.\n", _nfont);
  161 }
  162 
  163 int gFont::count()
  164 {
  165     if (!FONT_families) gFont::init();
  166     return FONT_n_families;
  167 }
  168 
  169 const char *gFont::familyItem(int pos)
  170 {
  171     if (!FONT_families) gFont::init();
  172     if ( (pos < 0) || (pos >= FONT_n_families) ) return NULL; 
  173     
  174     return (const char *)g_list_nth(FONT_families, pos)->data;
  175 }
  176 
  177 #if 0
  178 void gFont::updateWidget()
  179 {
  180     if (!wid) return;
  181 
  182     PangoFontDescription *desc = pango_context_get_font_description(ct);
  183     gtk_widget_modify_font(wid,desc);
  184     
  185     if (G_OBJECT_TYPE(wid)==GTK_TYPE_LABEL)
  186     {
  187         PangoAttrList *pal=pango_attr_list_new();
  188         if (strike)
  189         {
  190             PangoAttribute *pa=pango_attr_strikethrough_new(true);
  191             pa->start_index = 0;
  192             pa->end_index = g_utf8_strlen(gtk_label_get_text(GTK_LABEL(wid)), -1); 
  193             pango_attr_list_insert(pal, pa);
  194         }
  195         if (uline)
  196         {
  197             PangoAttribute *pa=pango_attr_underline_new(PANGO_UNDERLINE_SINGLE);
  198             pa->start_index = 0;
  199             pa->end_index = g_utf8_strlen(gtk_label_get_text(GTK_LABEL(wid)), -1); 
  200             pango_attr_list_insert(pal, pa);
  201         }
  202         gtk_label_set_attributes(GTK_LABEL(wid), pal);
  203         pango_attr_list_unref(pal);
  204     }
  205 
  206 }
  207 #endif
  208 
  209 void gFont::reset()
  210 {
  211     strike = false;
  212     uline = false;
  213 
  214     _bold_set = false;
  215     _italic_set = false;
  216     _name_set = false;
  217     _size_set = false;
  218     _strikeout_set = false;
  219     _underline_set = false;
  220 }
  221 
  222 void gFont::setAll(bool v)
  223 {
  224     _bold_set = v;
  225     _italic_set = v;
  226     _name_set = v;
  227     _size_set = v;
  228     _strikeout_set = v;
  229     _underline_set = v;
  230 }
  231 
  232 void gFont::setAllFrom(gFont *font)
  233 {
  234     if (!font)
  235         setAll(false);
  236     else
  237     {
  238         _bold_set = font->_bold_set;
  239         _italic_set = font->_italic_set;
  240         _name_set = font->_name_set;
  241         _size_set = font->_size_set;
  242         _strikeout_set = font->_strikeout_set;
  243         _underline_set = font->_underline_set;
  244     }
  245 }
  246 
  247 void gFont::realize()
  248 {
  249     ct = NULL;
  250     _height = 0;
  251     _metrics = NULL;
  252 
  253     reset();
  254     
  255     _nfont++;  
  256 }
  257 
  258 PangoFontMetrics *gFont::metrics()
  259 {
  260     if (!_metrics)
  261     {
  262         PangoFontDescription *desc = pango_context_get_font_description(ct);
  263         _metrics = pango_context_get_metrics(ct, desc, NULL);
  264     }
  265     
  266     return _metrics;
  267 }
  268 
  269 void gFont::invalidateMetrics()
  270 {
  271     if (_metrics)
  272     {
  273         pango_font_metrics_unref(_metrics);
  274         _metrics = NULL;
  275     }
  276     _height = 0;
  277 }
  278 
  279 void gFont::initFlags()
  280 {
  281     gFont *comp = new gFont();
  282     
  283     _bold_set = comp->bold() != bold();
  284     _italic_set = comp->italic() != italic();
  285     _name_set = strcmp(comp->name(), name()) != 0;
  286     _size_set = comp->size() != size();
  287     _strikeout_set = comp->strikeout() != strikeout();
  288     _underline_set = comp->underline() != underline();
  289 
  290     checkMustFixSpacing();
  291 }
  292 
  293 void gFont::create()
  294 {
  295 #ifdef GTK3
  296 
  297     char *font;
  298     PangoFontDescription *fd;
  299 
  300     g_object_get(gtk_settings_get_default(), "gtk-font-name", &font, (char *)NULL);
  301 
  302     realize();
  303 
  304     fd = pango_font_description_from_string(font);
  305     g_free(font);
  306 
  307     ct = gdk_pango_context_get();
  308 
  309     pango_context_set_font_description(ct, fd);
  310     pango_font_description_free(fd);
  311     
  312 #else
  313     
  314     GtkStyle *sty = gtk_widget_get_default_style();
  315     
  316     realize();
  317     ct = gdk_pango_context_get();
  318     pango_context_set_font_description(ct, sty->font_desc);
  319     
  320 #endif
  321     
  322     checkMustFixSpacing();
  323 }
  324 
  325 gFont::gFont() : gShare()
  326 {
  327     create();
  328 }
  329 
  330 gFont::gFont(GtkWidget *wid) : gShare()
  331 {
  332     PangoAttrList *lst;
  333     PangoAttrIterator* iter;
  334     
  335     realize();
  336     ct = gtk_widget_create_pango_context(wid);
  337     g_object_ref(ct);
  338     
  339     if (G_OBJECT_TYPE(wid)==GTK_TYPE_LABEL)
  340     {
  341         lst=gtk_label_get_attributes(GTK_LABEL(wid));
  342         if (lst)
  343         {
  344             iter=pango_attr_list_get_iterator(lst);
  345             if (pango_attr_iterator_get(iter,PANGO_ATTR_STRIKETHROUGH)) strike=true;
  346             if (pango_attr_iterator_get(iter,PANGO_ATTR_UNDERLINE)) uline=true;
  347             pango_attr_iterator_destroy(iter);
  348         }
  349     } 
  350     
  351     initFlags();
  352 }
  353 
  354 gFont::gFont(PangoFontDescription *fd) : gShare()
  355 {
  356     realize();
  357     ct = gdk_pango_context_get();
  358     pango_context_set_font_description(ct, fd);
  359     initFlags();
  360 }
  361 
  362 gFont::gFont(const char *name) : gShare()
  363 {
  364     create();
  365     set_font_from_string(this, name);
  366 }
  367 
  368 void gFont::copyTo(gFont *dst)
  369 {
  370     dst->reset();
  371     if (_name_set) dst->setName(name());
  372     if (_size_set) dst->setSize(size());
  373     if (_bold_set) dst->setBold(bold());
  374     if (_italic_set) dst->setItalic(italic());
  375     if (_underline_set) dst->setUnderline(underline());
  376     if (_strikeout_set) dst->setStrikeout(strikeout());
  377 }
  378 
  379 void gFont::mergeFrom(gFont *src)
  380 {
  381     if (!_name_set && src->_name_set) setName(src->name());
  382     if (!_size_set && src->_size_set) setSize(src->size());
  383     if (!_bold_set && src->_bold_set) setBold(src->bold());
  384     if (!_italic_set && src->_italic_set) setItalic(src->italic());
  385     if (!_underline_set && src->_underline_set) setUnderline(src->underline());
  386     if (!_strikeout_set && src->_strikeout_set) setStrikeout(src->strikeout());
  387 }
  388 
  389 gFont *gFont::copy()
  390 {
  391     gFont *f = new gFont();
  392     copyTo(f);
  393     return f;
  394 }
  395 
  396 gFont::~gFont()
  397 {
  398     g_object_unref(ct);
  399     _nfont--;
  400 }
  401 
  402 
  403 int gFont::ascent()
  404 {
  405     return gt_pango_to_pixel(pango_font_metrics_get_ascent(metrics()));
  406 }
  407 
  408 float gFont::ascentF()
  409 {
  410     return (float)pango_font_metrics_get_ascent(metrics()) / PANGO_SCALE;
  411 }
  412 
  413 int gFont::descent()
  414 {
  415     return gt_pango_to_pixel(pango_font_metrics_get_descent(metrics()));
  416 }
  417 
  418 bool gFont::bold()
  419 {
  420     PangoFontDescription *desc = pango_context_get_font_description(ct);
  421     PangoWeight w;
  422         
  423     w = pango_font_description_get_weight(desc);
  424     return (w > PANGO_WEIGHT_NORMAL);
  425 }
  426 
  427 void gFont::setBold(bool vl)
  428 {
  429     PangoFontDescription *desc = pango_context_get_font_description(ct);
  430 
  431     if (vl)
  432         pango_font_description_set_weight(desc,PANGO_WEIGHT_BOLD);
  433     else
  434         pango_font_description_set_weight(desc,PANGO_WEIGHT_NORMAL);
  435     
  436     _bold_set = true;
  437     invalidateMetrics();
  438 }
  439 
  440 bool gFont::italic()
  441 {
  442     PangoFontDescription *desc = pango_context_get_font_description(ct);
  443 
  444     return pango_font_description_get_style(desc) !=PANGO_STYLE_NORMAL; 
  445 }
  446 
  447 void gFont::setItalic(bool vl)
  448 {
  449     PangoFontDescription *desc = pango_context_get_font_description(ct);
  450 
  451     if (vl)
  452         pango_font_description_set_style(desc,PANGO_STYLE_ITALIC);
  453     else
  454         pango_font_description_set_style(desc,PANGO_STYLE_NORMAL);
  455         
  456     _italic_set = true;
  457     invalidateMetrics();
  458 }
  459 
  460 char* gFont::name()
  461 {
  462     PangoFontDescription *desc = pango_context_get_font_description(ct);
  463 
  464     return (char *)pango_font_description_get_family (desc);    
  465 }
  466 
  467 void gFont::setName(char *nm)
  468 {
  469     PangoFontDescription *desc = pango_context_get_font_description(ct);
  470     
  471     pango_font_description_set_family(desc, nm);
  472     
  473     _name_set = true;
  474     invalidateMetrics();
  475     
  476     checkMustFixSpacing();
  477 }
  478 
  479 double gFont::size()
  480 {
  481     double size;    
  482 
  483     PangoFontDescription *desc = pango_context_get_font_description(ct);
  484 
  485     size=pango_font_description_get_size(desc);
  486     return size / (double)PANGO_SCALE;
  487 }
  488 
  489 int gFont::grade()
  490 {
  491     double desktop = gDesktop::font()->size();
  492     return SIZE_TO_GRADE(size(), desktop);
  493 }
  494 
  495 void gFont::setSize(double sz)
  496 {
  497     PangoFontDescription *desc = pango_context_get_font_description(ct);
  498     
  499     pango_font_description_set_size(desc, (int)(sz * PANGO_SCALE + 0.5));
  500     
  501     _size_set = true;
  502     invalidateMetrics();
  503 }
  504 
  505 void gFont::setGrade(int grade)
  506 {
  507     double desktop = gDesktop::font()->size();
  508     
  509     if (grade < FONT_GRADE_MIN)
  510         grade = FONT_GRADE_MIN;
  511     else if (grade > FONT_GRADE_MAX)
  512         grade = FONT_GRADE_MAX;
  513     
  514     setSize(GRADE_TO_SIZE(grade, desktop));
  515 }
  516 
  517 const char *gFont::toString()
  518 {
  519     char *family;
  520     GString *desc;
  521     char *ret;
  522     int s;
  523     
  524     desc = g_string_new(NULL);
  525     
  526     family = name();
  527     if (isdigit(*family) && atof(family))
  528         g_string_append_printf(desc, "\"%s\"", family);
  529     else
  530         g_string_append(desc, family);
  531     
  532     s = (int)(size() * 10 + 0.5);
  533     
  534     g_string_append_printf(desc, ",%d", s / 10);
  535     if (s % 10)
  536         g_string_append_printf(desc, ".%d", s % 10);
  537     if (bold())
  538         g_string_append(desc, ",Bold");
  539     if (italic())
  540         g_string_append(desc, ",Italic");
  541     if (underline())
  542         g_string_append(desc, ",Underline");
  543     if (strikeout())
  544         g_string_append(desc, ",Strikeout");
  545 
  546     ret = g_string_free(desc, false);
  547     gt_free_later(ret);
  548     
  549     return ret;
  550 }
  551 
  552 const char *gFont::toFullString()
  553 {
  554     GString *desc = g_string_new("");
  555     char *ret;
  556     
  557     g_string_append_printf(desc, "[ ");
  558 
  559     if (_name_set)
  560         g_string_append_printf(desc, "%s ", name());
  561 
  562     if (_size_set)
  563         g_string_append_printf(desc, "%g ", (double)((int)(size() * 10 + 0.5)) / 10);
  564     
  565     if (_bold_set)
  566         g_string_append_printf(desc, "%s ", bold() ? "Bold" : "NotBold");
  567     if (_italic_set)
  568         g_string_append_printf(desc, "%s ", italic() ? "Italic" : "NotItalic");
  569     if (_underline_set)
  570         g_string_append_printf(desc, "%s ", underline() ? "Underline" : "NotUnderline");
  571     if (_strikeout_set)
  572         g_string_append_printf(desc, "%s ", strikeout() ? "Strikeout" : "NotStrikeout");
  573 
  574     g_string_append_printf(desc, "]");
  575     
  576     ret = g_string_free(desc, false);
  577     gt_free_later(ret);
  578     return ret;
  579 }
  580 
  581 void gFont::textSize(const char *text, int len, float *w, float *h)
  582 {
  583     PangoLayout *ly;
  584     PangoRectangle ink_rect, rect = { 0 };
  585     
  586     if (text && len)
  587     {
  588         ly = pango_layout_new(ct);
  589         pango_layout_set_text(ly, text, len);   
  590         gt_set_layout_from_font(ly, this);
  591         pango_layout_get_extents(ly, &ink_rect, &rect);
  592         g_object_unref(ly);
  593         rect.width = Max(rect.width, ink_rect.width);
  594         rect.height = Max(rect.height, ink_rect.height);
  595     }
  596     
  597     if (w) *w = (float)rect.width / PANGO_SCALE;
  598     if (h)
  599     {
  600         *h = (float)rect.height / PANGO_SCALE;
  601         if (mustFixSpacing())
  602             *h += 1;
  603     }
  604 }
  605 
  606 int gFont::width(const char *text, int len)
  607 {
  608     float fw;
  609     textSize(text, len, &fw, NULL);
  610     return gt_pango_to_pixel(fw * PANGO_SCALE);
  611 }
  612 
  613 int gFont::height(const char *text, int len)
  614 {
  615     int n = count_newlines(text, len);
  616     return height() * (n + 1);
  617 }
  618 
  619 int gFont::height()
  620 {
  621     if (!_height)
  622     {
  623         float h1, h2;
  624         textSize("A\nA", 3, NULL, &h1);
  625         textSize("A\nA\nA", 5, NULL, &h2);
  626         _height = gt_pango_to_pixel((h2 - h1) * PANGO_SCALE);
  627     }
  628     return _height;
  629 }
  630 
  631 bool gFont::scalable()
  632 {
  633     bool ret=false;
  634     
  635     PangoFontDescription *desc = pango_context_get_font_description(ct);
  636     //PangoFontDescription *tmp;
  637     const char* name=pango_font_description_get_family(desc);
  638     PangoFontFamily **families;
  639     PangoFontFace **faces;
  640     int *sizes;
  641     int n_families;
  642     int n_faces;
  643     int n_sizes;
  644     //int b2;
  645     const char *buf;
  646     
  647     if (!name) return false;
  648     
  649     pango_context_list_families(ct,&families,&n_families);
  650     
  651     if (!families) return false;
  652     
  653     for (int bucle=0;bucle<n_families;bucle++)
  654     {
  655         buf=pango_font_family_get_name(families[bucle]);
  656         if (!strcmp(buf,name))
  657         {
  658             pango_font_family_list_faces(families[bucle],&faces,&n_faces);
  659             if (faces)
  660             {
  661                 pango_font_face_list_sizes(faces[0],&sizes,&n_sizes);
  662                 if (sizes) 
  663                     g_free(sizes);
  664                 else
  665                     ret=true;
  666                 g_free(faces);
  667                 g_free(families);
  668                 return ret;
  669             }
  670             else
  671             {
  672                 g_free(families);
  673                 return false;
  674             }
  675         }
  676         
  677     }
  678     
  679     g_free(families);
  680     return false;
  681 }
  682 
  683 bool gFont::fixed()
  684 {
  685     bool ret=false;
  686     
  687     PangoFontDescription *desc = pango_context_get_font_description(ct);
  688     const char* name=pango_font_description_get_family(desc);
  689     PangoFontFamily **families;
  690     int n_families;
  691     const char *buf;
  692     
  693     if (!name) return false;
  694     
  695     pango_context_list_families(ct,&families,&n_families);
  696     
  697     if (!families) return false;
  698     
  699     for (int bucle=0;bucle<n_families;bucle++)
  700     {
  701         buf=pango_font_family_get_name(families[bucle]);
  702         if (!strcmp(buf,name))
  703         {
  704             ret=pango_font_family_is_monospace (families[bucle]);
  705             g_free(families);
  706             return ret;
  707         }
  708         
  709     }
  710     
  711     g_free(families);
  712     return false;
  713 }
  714 
  715 char** gFont::styles()
  716 {
  717     return 0;
  718 }
  719 
  720 int gFont::resolution()
  721 {
  722     return 0;
  723 }
  724 
  725 
  726 bool gFont::strikeout()
  727 {
  728     return strike;
  729 }
  730 
  731 bool gFont::underline()
  732 {
  733     return uline;
  734 }
  735 
  736 
  737 void gFont::setResolution(int vl)
  738 {
  739 }
  740 
  741 void gFont::setStrikeout(bool vl)
  742 {
  743     //stub("setStrikeOut(): partially working");
  744     strike=vl;
  745     _strikeout_set = true;
  746     //updateWidget();
  747 }
  748 
  749 void gFont::setUnderline(bool vl)
  750 {
  751     //stub("setUnderline(): partially working");
  752     uline=vl;
  753     _underline_set = true;
  754     //updateWidget();
  755 }
  756 
  757 
  758 bool gFont::isAllSet()
  759 {
  760     return 
  761         _bold_set
  762         && _italic_set
  763         && _name_set
  764         && _size_set
  765         && _strikeout_set
  766         && _underline_set;
  767 }
  768 
  769 void gFont::richTextSize(const char *text, int len, float sw, float *w, float *h)
  770 {
  771     PangoLayout *ly;
  772     PangoRectangle ink_rect, rect = { 0 };
  773     char *html;
  774     
  775     if (text && len)
  776     {
  777         ly = pango_layout_new(ct);
  778         if (sw > 0)
  779         {
  780             pango_layout_set_wrap(ly, PANGO_WRAP_WORD_CHAR);
  781             pango_layout_set_width(ly, (int)ceilf(sw * PANGO_SCALE));
  782         }
  783         html = gt_html_to_pango_string(text, len, false);
  784         pango_layout_set_markup(ly, html, -1);  
  785         gt_add_layout_from_font(ly, this);
  786         pango_layout_get_extents(ly, &ink_rect, &rect);
  787         g_free(html);
  788         g_object_unref(ly);
  789         rect.width = Max(rect.width, ink_rect.width);
  790         rect.height = Max(rect.height, ink_rect.height);
  791     }
  792     
  793     if (w) *w = (float)rect.width / PANGO_SCALE;
  794     if (h)
  795     {
  796         *h = (float)rect.height / PANGO_SCALE;
  797         if (mustFixSpacing())
  798             *h += 1;
  799     }
  800 }
  801 
  802 void gFont::checkMustFixSpacing()
  803 {
  804     _must_fix_spacing = ::strcmp(name(), "Gambas") == 0;
  805 }