// Reset text formatting parameters.
void Adafruit_Thermal::setDefault(){
  online();
  justify('L');
  inverseOff();
  doubleHeightOff();
  setLineHeight(30);
  boldOff();
  underlineOff();
  setBarcodeHeight(50);
  setSize('s');
  setCharset();
  setCodePage();
}
Exemple #2
0
void Nls::setLocalization( const char *loc)
{
    std::string path( Environment.value( "WIPFC" ) );
    if( path.length() )
#if !defined( __UNIX__ ) && !defined( __APPLE__ )
        path += '\\';
#else
        path += '/';
#endif
    path += loc;
    path += ".nls";
    std::FILE *nls = std::fopen( path.c_str(), "r" );
    if( nls == 0 )
        throw FatalError( ERR_LANG );
    readNLS( nls );
    std::fclose( nls );
#if defined( __UNIX__ ) || defined( __APPLE__ )
    std::setlocale( LC_ALL, loc );  //this doesn't really do anything in OW either
#endif
    setCodePage( country.codePage );
}
    //////////////////////////////////////////////////////////////////////////////////////////
    // RtfWriter::writeHeader
    //! Writes RTF header
    //! 
    //! \param[in] font - Font name
    //! 
    //! \throw wtl::domain_error - I/O error occurred
    //////////////////////////////////////////////////////////////////////////////////////////
    void  writeHeader(const char* font)
    {
      // Header
      writeString("{\\rtf1\\ansi");

      // Set codepage + language
      setCodePage(1250);
      setDefaultFont(0);
      setLanguage(2057);      // English UK  (0x0809 == 2057)

      // Font table
      writeString("{\\fonttbl{\\f0\\fswiss\\fcharset0 ");
      write(font);
      writeString(";}}\n");

      // Colour table
      writeString("{\\colortbl");
      writeString(";");  // Define colour 0 as 'auto-colour'
      for (COLORREF c : Colours)
        writeColour(c);
      writeString("}\n");


      // Unknown previous formatting: //\\sa200\\sl276\\slmult1
      // 
      // \saN == spacing after
      // \slN == space between lines
      // \smult == Line spacing multiple
      // \pard == reset paragraph formatting

      // Set view: 0==None, 1==Page Layout view, 2==Outline view, 3==Master Document view, 4==Normal view, 5==Online Layout view
      writeString("\\viewkind4");

      // Set unicode destination (not sure)
      writeString("\\uc1 ");

      // Reset paragraph
      resetParagraph();
    }
Buffer::Buffer(QWidget *parent) :
        ScintillaEdit(parent), m_language(0) {
    // Use Unicode code page
    m_encoding = Encoding::fromName("UTF-8");
    setCodePage(SC_CP_UTF8);

    // Load the initial state from the configuration
    loadConfiguration();

    // Setup the margins
    setMarginMaskN(Fold, SC_MASK_FOLDERS);
    setMarginSensitiveN(Icon, true);
    setMarginSensitiveN(Fold, true);
    setupMarginIcons();

    // Set up the indicators
    indicSetStyle(MatchBrace, INDIC_BOX);
    braceHighlightIndicator(true, MatchBrace);

    connect(this, SIGNAL(updateUi()), this, SLOT(onUpdateUi()));
    connect(this, SIGNAL(linesAdded(int)), this, SLOT(onLinesAdded(int)));
    connect(this, SIGNAL(marginClicked(int,int,int)), this,
            SLOT(onMarginClicked(int,int,int)));
}