Skip to content

Commit

Permalink
Last fixes for 0.9.5
Browse files Browse the repository at this point in the history
  • Loading branch information
lpugin committed Jan 12, 2015
1 parent 1cff063 commit 4cb94fe
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 33 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Binary file modified images/page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion include/vrv/toolkit.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 9 additions & 1 deletion src/toolkit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
{
Expand Down Expand Up @@ -278,6 +283,9 @@ bool Toolkit::ParseOptions( const std::string &json_options ) {

if (json.has<jsonxx::Number>("border"))
SetBorder( json.get<jsonxx::Number>("border") );

if (json.has<jsonxx::String>("font"))
SetFont(json.get<jsonxx::String>("font"));

if (json.has<jsonxx::Number>("pageWidth"))
SetPageWidth( json.get<jsonxx::Number>("pageWidth") );
Expand Down
2 changes: 1 addition & 1 deletion src/verse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ int Verse::PrepareLyrics( ArrayPtrVoid params )

Syl *syl = dynamic_cast<Syl*>( 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;
}
Expand Down
52 changes: 25 additions & 27 deletions src/view_element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}


Expand Down
4 changes: 2 additions & 2 deletions tools/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <rdg> elements," << endl;
cerr << " --rdg-xpath-query=QUERY Set the xPath query for selecting <rdg> elements," << endl;
cerr << " for example: \"./rdg[contains(@source, 'source-id')]\"" << endl;

// Debugging options
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 4cb94fe

Please sign in to comment.