mod/maxgui.mod/fltkmaxgui.mod/src/Fl_Text_Display.cxx
double Fl_Text_Display::measure_proportional_character(const char *s, int xPix, int pos) const {
  IS_UTF8_ALIGNED(s)
  
  if (*s=='\t') {
    int tab = col_to_x(4);
    return (((xPix/tab)+1)*tab) - xPix;
  }
  
  int charLen = fl_utf8len(*s), style = 0;
  if (mStyleBuffer) {
    style = mStyleBuffer->byte_at(pos);
  }
  return string_width(s, charLen, style);
}
/**
 \brief Wrapping calculations.
 
 Measure the width in pixels of the first character of string "s" at a
 particular column "colNum" and buffer position "pos".  This is for measuring
 characters in proportional or mixed-width highlighting fonts.

 A note about proportional and mixed-width fonts: the mixed width and
 proportional font code in nedit does not get much use in general editing,
 because nedit doesn't allow per-language-mode fonts, and editing programs
 in a proportional font is usually a bad idea, so very few users would
 choose a proportional font as a default.  There are still probably mixed-
 width syntax highlighting cases where things don't redraw properly for
 insertion/deletion, though static display and wrapping and resizing
 should now be solid because they are now used for online help display.
 
 \param s text string
 \param xPix x pixel position needed for calculating tab widths
 \param pos offset within string
 \return width of character in pixels
 */
\brief Wrapping calculations.

A note about proportional and mixed-width fonts: the mixed width and
proportional font code in nedit does not get much use in general editing,
because nedit doesn't allow per-language-mode fonts, and editing programs
in a proportional font is usually a bad idea, so very few users would
choose a proportional font as a default.  There are still probably mixed
width syntax highlighting cases where things don't redraw properly for
insertion/deletion, though static display and wrapping and resizing
should now be solid because they are now used for online help display.

\param s text string
\param xPix x pixel position needed for calculating tab widths
\param pos offset within string
\return width of character in pixels
\ brief Wrapping calculations . A note about proportional and mixed - width fonts : the mixed width and proportional font code in nedit does not get much use in general editing because nedit doesn ' t allow per - language - mode fonts and editing programs in a proportional font is usually a bad idea so very few users would choose a proportional font as a default . There are still probably mixed width syntax highlighting cases where things don ' t redraw properly for insertion / deletion though static display and wrapping and resizing should now be solid because they are now used for online help display . \ param s text string \ param xPix x pixel position needed for calculating tab widths \ param pos offset within string \ return width of character in pixels
double Fl_Text_Display::measure_proportional_character(const char *s, int xPix, int pos) const {
  IS_UTF8_ALIGNED(s)
  if (*s=='\t') {
    int tab = col_to_x(4);
    return (((xPix/tab)+1)*tab) - xPix;
  }
  int charLen = fl_utf8len(*s), style = 0;
  if (mStyleBuffer) {
    style = mStyleBuffer->byte_at(pos);
  }
  return string_width(s, charLen, style);
}
double Fl_Text_Display :: measure_proportional_character ( const char * s , int xPix , int pos ) const { IS_UTF8_ALIGNED ( s ) if ( * s == ' \t ' ) { int tab = col_to_x ( 4 ) ; return ( ( ( xPix / tab ) + 1 ) * tab ) - xPix ; } int charLen = fl_utf8len ( * s ) , style = 0 ; if ( mStyleBuffer ) { style = mStyleBuffer -> byte_at ( pos ) ; } return string_width ( s , charLen , style ) ; }
\brief Wrapping calculations.
\ brief Wrapping calculations .