Loading ...
Sorry, an error occurred while loading the content.

Re[2]: Vim*sgiMode: true causes Error: Unresolved inheritance operation

Expand Messages
  • Rainer M. Canavan
    ... [...] ... That s exactly what it s doing over here. The problem is that the dialog just doesn t work at first - it doesn t display a proper preview and
    Message 1 of 4 , Aug 31 1:51 PM
    • 0 Attachment
      Tony Mechelynck <antoine.mechelynck@...> wrote:
      > On 31/08/13 19:38, Rainer M. Canavan wrote:
      > >
      >

      [...]

      > >
      > > The Font Selector doesn't seem to work with either Motif 2.1 or 1.2.
      > > While it displays a font in the "SampleLable" box at startup, I can't
      > > seem to get it to display anything but "no specific match" in the
      > > Name and Sample Label box, if I select anything at all, including "*",
      > > in the Font, Style or Size boxes. The lists in each of the boxes
      > > are limited to whatever matches the criteria selected in the other boxes,
      > > so the dialog is at least partially working.
      > >
      > > Is anyone still left here who cares about the motif GUI?
      > >
      > > thanks,
      > >
      > > rainer
      > >
      > In some GUIs, including Motif, you're supposed to be able to get a font
      > selector dialog by
      >
      > :set guifont=*
      >
      >
      > This dialog will only show fonts acceptable for the Normal group,
      > however, which means only fonts defined with the monotype property set
      > in their font file.

      That's exactly what it's doing over here. The problem is that the
      dialog just doesn't work at first - it doesn't display a proper preview
      and complains about an invalid font selection on OK. Thanks to you hints
      I've now discovered that the dialog starts working if I manually set a
      valid font once e.g. with

      :set guifont=-*-lucidatypewriter-medium-r-*-*-14-*-75-75-m-*-*-*


      > For Motif and Athena, you can set the fonts for the Menu and Tooltip
      > groups separately, but not by means of a dialog. Your colorscheme will
      > have to include a :hi line with the font argument, and on Motif and
      > Athena (and any X11 GUI other than GTK2) the "font name" value is a
      > complicated name, something like (I'm guessing what would apply to
      > Helvetica Oblique)
      >
      > hi Menu font=*-helvetica-medium-o-normal-*-*-75-*-*-p-*-*

      I think the -p- is not in the right place.

      > where -o- means Oblique and -p- means Proportional. Normally they would
      > be -r- (Roman) and -m- (Monotype) respectively, for something usable for
      > the text you edit (and settable in 'guifont', but on this system I have
      > no monotype Helvetica font -no Helvetica Mono- AFAICT). The asterisks
      > are wildcards.

      There is such a thing as Helvetica Monospace, but I don't have it. I've
      just picked something else with xfontsel.

      > see
      > http://vim.wikia.com/Setting_the_font_in_the_GUI
      > :help XLFD

      > If it doesn't work on your first try, you may have to check which XLFDs
      > are available on your system for the font you want and/or use trial and
      > error.

      Those do actually work. I wasn't aware of the limitation that the GUI fonts
      had to be monotype as well, and that they can be set from within vim
      instead of the usual Xresources. :hi Menu font= complains with an appropriate
      error message if I try e.g. Helvetica. If I'm not mistaken, the fixed_width
      requirement is controlled by the do_menu flag in hl_do_font() in src/syntax.c:

      HL_TABLE()[idx].sg_fontset = fontset_name2handle(arg, 0
      # ifdef FONTSET_ALWAYS
      || do_menu
      # endif
      # ifdef FEAT_BEVAL_TIP
      || do_tooltip
      # endif
      );

      Can anyone explain why this is done?


      regards,

      rainer

      --
      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      ---
      You received this message because you are subscribed to the Google Groups "vim_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Tony Mechelynck
      ... [...] ... Well, my guess (but I don t know the insides of Vim code as well as I know how to use it) would be that there is something (maybe the monospace
      Message 2 of 4 , Aug 31 6:22 PM
      • 0 Attachment
        On 31/08/13 22:51, Rainer M. Canavan wrote:
        > Tony Mechelynck <antoine.mechelynck@...> wrote:
        [...]
        >> If it doesn't work on your first try, you may have to check which XLFDs
        >> are available on your system for the font you want and/or use trial and
        >> error.
        >
        > Those do actually work. I wasn't aware of the limitation that the GUI fonts
        > had to be monotype as well, and that they can be set from within vim
        > instead of the usual Xresources. :hi Menu font= complains with an appropriate
        > error message if I try e.g. Helvetica. If I'm not mistaken, the fixed_width
        > requirement is controlled by the do_menu flag in hl_do_font() in src/syntax.c:
        >
        > HL_TABLE()[idx].sg_fontset = fontset_name2handle(arg, 0
        > # ifdef FONTSET_ALWAYS
        > || do_menu
        > # endif
        > # ifdef FEAT_BEVAL_TIP
        > || do_tooltip
        > # endif
        > );
        >
        > Can anyone explain why this is done?
        >
        >
        > regards,
        >
        > rainer
        >

        Well, my guess (but I don't know the insides of Vim code as well as I
        know how to use it) would be that there is "something" (maybe the
        monospace requirement) that the fontset_name2handle() function handles
        differently when setting the Menu or Tooltip highlight (which don't
        exist on my gvim for GTK2).

        BTW, FONTSET_ALWAYS is defined at gui.h line 82 if FEAT_XFONTSET is defined.

        Looks like the "interesting part", including source comments, is longer
        than that: e.g. at lines 8314 to 8407:

        > /*
        > * Get the font or fontset for one highlight group.
        > */
        > static void
        > hl_do_font(idx, arg, do_normal, do_menu, do_tooltip, free_font)
        > int idx;
        > char_u *arg;
        > int do_normal; /* set normal font */
        > int do_menu UNUSED; /* set menu font */
        > int do_tooltip UNUSED; /* set tooltip font */
        > int free_font; /* free current font/fontset */
        > {
        > # ifdef FEAT_XFONTSET
        > /* If 'guifontset' is not empty, first try using the name as a
        > * fontset. If that doesn't work, use it as a font name. */
        > if (*p_guifontset != NUL
        > # ifdef FONTSET_ALWAYS
        > || do_menu
        > # endif
        > # ifdef FEAT_BEVAL_TIP
        > /* In Athena & Motif, the Tooltip highlight group is always a fontset */
        > || do_tooltip
        > # endif
        > )
        > {
        > if (free_font)
        > gui_mch_free_fontset(HL_TABLE()[idx].sg_fontset);
        > HL_TABLE()[idx].sg_fontset = fontset_name2handle(arg, 0
        > # ifdef FONTSET_ALWAYS
        > || do_menu
        > # endif
        > # ifdef FEAT_BEVAL_TIP
        > || do_tooltip
        > # endif
        > );
        > }
        > if (HL_TABLE()[idx].sg_fontset != NOFONTSET)
        > {
        > /* If it worked and it's the Normal group, use it as the normal
        > * fontset. Same for the Menu group. */
        > if (do_normal)
        > gui_init_font(arg, TRUE);
        > # if (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA)) && defined(FEAT_MENU)
        > if (do_menu)
        > {
        > # ifdef FONTSET_ALWAYS
        > gui.menu_fontset = HL_TABLE()[idx].sg_fontset;
        > # else
        > /* YIKES! This is a bug waiting to crash the program */
        > gui.menu_font = HL_TABLE()[idx].sg_fontset;
        > # endif
        > gui_mch_new_menu_font();
        > }
        > # ifdef FEAT_BEVAL
        > if (do_tooltip)
        > {
        > /* The Athena widget set cannot currently handle switching between
        > * displaying a single font and a fontset.
        > * If the XtNinternational resource is set to True at widget
        > * creation, then a fontset is always used, otherwise an
        > * XFontStruct is used.
        > */
        > gui.tooltip_fontset = (XFontSet)HL_TABLE()[idx].sg_fontset;
        > gui_mch_new_tooltip_font();
        > }
        > # endif
        > # endif
        > }
        > else
        > # endif
        > {
        > if (free_font)
        > gui_mch_free_font(HL_TABLE()[idx].sg_font);
        > HL_TABLE()[idx].sg_font = font_name2handle(arg);
        > /* If it worked and it's the Normal group, use it as the
        > * normal font. Same for the Menu group. */
        > if (HL_TABLE()[idx].sg_font != NOFONT)
        > {
        > if (do_normal)
        > gui_init_font(arg, FALSE);
        > #ifndef FONTSET_ALWAYS
        > # if (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA)) && defined(FEAT_MENU)
        > if (do_menu)
        > {
        > gui.menu_font = HL_TABLE()[idx].sg_font;
        > gui_mch_new_menu_font();
        > }
        > # endif
        > #endif
        > }
        > }
        > }
        >
        > #endif /* FEAT_GUI */

        Best regards,
        Tony.
        --
        He who laughs last usually had to have joke explained.

        --
        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        ---
        You received this message because you are subscribed to the Google Groups "vim_dev" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      Your message has been successfully submitted and would be delivered to recipients shortly.