diff --git a/README.md b/README.md index a0b26198f6d..f844f366fda 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,6 @@ The code for the attribute classes of Verovio are generated from the MEI schema Example output -------------- -This page was generated with version 0.9.0 +This page was generated with version 0.9.5 ![Example page](/images/page.png) diff --git a/images/page.png b/images/page.png index 1162d322a7d..03d3c1eaf2f 100644 Binary files a/images/page.png and b/images/page.png differ diff --git a/include/vrv/toolkit.h b/include/vrv/toolkit.h index 39aea6aa3aa..bb328389f57 100644 --- a/include/vrv/toolkit.h +++ b/include/vrv/toolkit.h @@ -218,7 +218,14 @@ class Toolkit void SetRdgXPathQuery( std::string const &rdgXPathQuery ) { m_rdgXPathQuery = rdgXPathQuery; }; std::string GetRdgXPathQuery() { return m_rdgXPathQuery; }; ///@} - + + /** + * @name Set a specific font + */ + ///@{ + bool SetFont( std::string const &font ); + ///@} + /** * @name Get the pages for a loaded file * The SetFormat with ConvertFileFormat does not perform any validation diff --git a/src/toolkit.cpp b/src/toolkit.cpp index 21b9cdf121e..b5ebfe47116 100644 --- a/src/toolkit.cpp +++ b/src/toolkit.cpp @@ -144,8 +144,13 @@ bool Toolkit::SetFormat( std::string const &informat ) } return true; }; + - +bool Toolkit::SetFont( std::string const &font ) +{ + return Resources::SetFont(font); +}; + bool Toolkit::LoadFile( const std::string &filename ) { @@ -278,6 +283,9 @@ bool Toolkit::ParseOptions( const std::string &json_options ) { if (json.has("border")) SetBorder( json.get("border") ); + + if (json.has("font")) + SetFont(json.get("font")); if (json.has("pageWidth")) SetPageWidth( json.get("pageWidth") ); diff --git a/src/verse.cpp b/src/verse.cpp index 50c248f9130..c3efeb78e99 100644 --- a/src/verse.cpp +++ b/src/verse.cpp @@ -99,7 +99,7 @@ int Verse::PrepareLyrics( ArrayPtrVoid params ) Syl *syl = dynamic_cast( this->GetFirst( &typeid(Syl) ) ); if (syl) { - std::cout << UTF16to8( syl->GetText().c_str() ) << std::endl; + //std::cout << UTF16to8( syl->GetText().c_str() ) << std::endl; } return FUNCTOR_CONTINUE; } diff --git a/src/view_element.cpp b/src/view_element.cpp index 1172ded66de..b0a26826877 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -1184,34 +1184,32 @@ void View::DrawMensurSlash ( DeviceContext *dc, int a, int yy, Staff *staff ) void View::DrawMensurFigures( DeviceContext *dc, int x, int y, int num, int numBase, Staff *staff) { - assert( dc ); // DC cannot be NULL - - int ynum, yden; - std::string s; + assert( dc ); // DC cannot be NULL + + int ynum, yden; std::wstring wtext; - - if (numBase) - { - ynum = y - (m_doc->m_drawingHalfInterl[staff->staffSize]*4); - yden = ynum - (m_doc->m_drawingInterl[staff->staffSize]*2); - } - else - ynum = y - (m_doc->m_drawingHalfInterl[staff->staffSize]*6); - - if (numBase > 9 || num > 9) // avancer - x += m_doc->m_drawingUnit*2; - - s = StringFormat("%u",num); - // FIXME (wtext instead of w) - DrawSmuflString ( dc, x, ynum, wtext, 1, staff->staffSize); // '1' = centrer - - if (numBase) - { - s = StringFormat("%u",numBase); - // FIXME (wtext instead of w) - DrawSmuflString ( dc, x, yden, wtext, 1, staff->staffSize); // '1' = centrer - } - return; + + if (numBase) + { + ynum = y - (m_doc->m_drawingHalfInterl[staff->staffSize]*2); + yden = ynum - (m_doc->m_drawingInterl[staff->staffSize]*2); + } + else + ynum = y - (m_doc->m_drawingHalfInterl[staff->staffSize]*4); + + if (numBase > 9 || num > 9) { + x += m_doc->m_drawingUnit*2; + } + + wtext = IntToTimeSigFigures(num); + DrawSmuflString ( dc, x, ynum, wtext, 1, staff->staffSize); // '1' = centrer + + if (numBase) + { + wtext = IntToTimeSigFigures(numBase); + DrawSmuflString ( dc, x, yden, wtext, 1, staff->staffSize); // '1' = centrer + } + return; } diff --git a/tools/main.cpp b/tools/main.cpp index f67bf5aeac3..6ea7153a648 100644 --- a/tools/main.cpp +++ b/tools/main.cpp @@ -110,7 +110,7 @@ void display_usage() { cerr << " --page=PAGE Select the page to engrave (default is 1)" << endl; - cerr << " --rdg-xpath-query Set the xPath query for selecting elements," << endl; + cerr << " --rdg-xpath-query=QUERY Set the xPath query for selecting elements," << endl; cerr << " for example: \"./rdg[contains(@source, 'source-id')]\"" << endl; // Debugging options @@ -304,7 +304,7 @@ int main(int argc, char** argv) } // Load a specified font - if (!font.empty() && !Resources::SetFont(font)) { + if (!font.empty() && !toolkit.SetFont(font)) { cerr << "Font '" << font << "' could not be loaded." << endl; exit(1); }