예제 #1
0
void View::DrawPgHeader(DeviceContext *dc, RunningElement *pgHeader)
{
    assert(dc);
    assert(pgHeader);

    dc->StartGraphic(pgHeader, "", pgHeader->GetUuid());

    FontInfo pgHeadTxt;

    TextDrawingParams params;

    // If we have not timestamp
    params.m_x = pgHeader->GetDrawingX();
    params.m_y = pgHeader->GetDrawingY();
    params.m_width = pgHeader->GetWidth();
    params.m_alignment = HORIZONTALALIGNMENT_NONE;
    params.m_laidOut = true;
    params.m_pointSize = m_doc->GetDrawingLyricFont(100)->GetPointSize();

    pgHeadTxt.SetPointSize(params.m_pointSize);

    dc->SetBrush(m_currentColour, AxSOLID);
    dc->SetFont(&pgHeadTxt);

    DrawRunningChildren(dc, pgHeader, params);

    dc->ResetFont();
    dc->ResetBrush();

    dc->EndGraphic(pgHeader, this);
}
예제 #2
0
void View::DrawLyricString ( DeviceContext *dc, int x, int y, std::wstring s, int staffSize)
{
    assert( dc );
    
    dc->StartText( ToDeviceContextX( x ), ToDeviceContextY( y ) );
    
    std::wistringstream iss( s  );
    std::wstring token;
    while( std::getline( iss, token, L'_' ))
    {
        dc->DrawText( UTF16to8( token.c_str() ), token );
        // no _
        if (iss.eof())
            break;
        
        FontInfo vrvTxt;
        vrvTxt.SetFaceName("VerovioText");
        vrvTxt.SetPointSize( m_doc->GetDrawingLyricFont(staffSize)->GetPointSize() );
        
        dc->SetFont( &vrvTxt );
        dc->VrvTextFont();
        std::wstring str;
        str.push_back(VRV_TEXT_E551);
        dc->DrawText( UTF16to8( str.c_str() ), str );
        dc->ResetFont();
    }
    //std::wcout << std::endl;
    
    dc->EndText( );
}
예제 #3
0
파일: view_text.cpp 프로젝트: DDMAL/verovio
void View::DrawRend(DeviceContext *dc, Rend *rend, int x, int y, bool &setX, bool &setY)
{
    assert(dc);
    assert(rend);

    dc->StartTextGraphic(rend, "", rend->GetUuid());

    FontInfo rendFont;
    bool customFont = false;
    if (rend->HasFontsize()) {
        customFont = true;
        rendFont.SetPointSize(rend->GetFontsize());
    }
    if (customFont) dc->SetFont(&rendFont);

    DrawTextChildren(dc, rend, x, y, setX, setY);

    if (customFont) dc->ResetFont();

    dc->EndTextGraphic(rend, this);
}