mod/maxgui.mod/fltkmaxgui.mod/src/Fl_Text_Display.cxx
double Fl_Text_Display::string_width( const char *string, int length, int style ) const {
  IS_UTF8_ALIGNED(string)

  Fl_Font font;
  Fl_Fontsize fsize;
  
  if ( mNStyles && (style & STYLE_LOOKUP_MASK) ) {
    int si = (style & STYLE_LOOKUP_MASK) - 'A';
    if (si < 0) si = 0;
    else if (si >= mNStyles) si = mNStyles - 1;
    
    font  = mStyleTable[si].font;
    fsize = mStyleTable[si].size;
  } else {
    font  = textfont();
    fsize = textsize();
  }
  fl_font( font, fsize );
  return fl_width( string, length );
}
/**
 \brief Find the width of a string in the font of a particular style.
 
 \param string the text
 \param length number of bytes instring
 \param style index into style table
 \return width of text segemnt in pixels
 */
\brief Find the width of a string in the font of a particular style.
\param string the text
\param length number of bytes instring
\param style index into style table
\return width of text segemnt in pixels
\ brief Find the width of a string in the font of a particular style . \ param string the text \ param length number of bytes instring \ param style index into style table \ return width of text segemnt in pixels
double Fl_Text_Display::string_width( const char *string, int length, int style ) const {
  IS_UTF8_ALIGNED(string)
  Fl_Font font;
  Fl_Fontsize fsize;
  if ( mNStyles && (style & STYLE_LOOKUP_MASK) ) {
    int si = (style & STYLE_LOOKUP_MASK) - 'A';
    if (si < 0) si = 0;
    else if (si >= mNStyles) si = mNStyles - 1;
    font  = mStyleTable[si].font;
    fsize = mStyleTable[si].size;
  } else {
    font  = textfont();
    fsize = textsize();
  }
  fl_font( font, fsize );
  return fl_width( string, length );
}
double Fl_Text_Display :: string_width ( const char * string , int length , int style ) const { IS_UTF8_ALIGNED ( string ) Fl_Font font ; Fl_Fontsize fsize ; if ( mNStyles && ( style & STYLE_LOOKUP_MASK ) ) { int si = ( style & STYLE_LOOKUP_MASK ) - ' ' ; if ( si < 0 ) si = 0 ; else if ( si >= mNStyles ) si = mNStyles - 1 ; font = mStyleTable [ si ] . font ; fsize = mStyleTable [ si ] . size ; } else { font = textfont ( ) ; fsize = textsize ( ) ; } fl_font ( font , fsize ) ; return fl_width ( string , length ) ; }
\brief Find the width of a string in the font of a particular style.
\ brief Find the width of a string in the font of a particular style .