MobileSheets Forums

Full Version: tabulature text size in chordpro file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is it possible to decrease the text size only for a tablature in a chrodpro file without changing the rest of the text?
Unfortunately, this is not currently supported. The chord pro spec lists a couple of commands that could be utilized for this, namely {textsize:fontsize} and {chordsize:fontsize}. I will go ahead and add proper support for these as well as a new one specifically for tabs, which will be {tabsize:fontsize}. For the sake of staying consistent with the spec, {textsize:fontsize} will modify the font size for both lyrics and tablature. This means you could adjust the font size before a tab and then after, or you could just utilize the new {tabsize:fontsize} directive. The advantage of the former approach is that your files would be properly supported by other programs.

I was just going back through feature requests, and noticed that I had a requester for additional settings to set the size for all tab and chorus sections, so I will be adding sliders for these that will show up when the advanced settings slider is on. It will still be possible to use the keywords to drive these if desired.
Without conflicting with the ChordPro standard the font settings could be handled by MSP. Many ChordPro apps do it this way.
I really would appreciate:
- being able to specify independent settings for {subtitle:, {comment:, {comment_italic:
  (different to lyrics and chords settings)
- being able to specify font colour, background colour, bold, italic independently for all types
As maintainer of the original Chord program (now called Chordii) and keeper of the ChordPro standard, I've been thinking about this for a long while now. And the answer is "Yes, it is highly desired" and "No, there's no end to what would be needed."
So I am considering a different approach.
We have a mechanism that allows flexible formatting of text and other things: HTML. With CSS, you can control everything to the level of precision you need. The only thing required is a ChordPro processing tool that produces HTML. This is actually quite simple and I have an experimental version that produces the following HTML:

<div class="title">Everybody Hurts</div>
<div class="subtitle">REM</div>
<div class="tab">...</div>
<div class="verse">
<table class="songline">
 <tr class="chords">
   <td>D </td><td>G </td><td>D </td><td>G </td><td>D </td>
 <tr class="lyrics">
   <td>When your day is </td><td>long and the </td><td>night, the night is </td><td>yours a</td><td>lone</td>
<table class="songline">
 <tr class="chords">
   <td>D </td><td>G </td><td>D </td><td>G </td>
 <tr class="lyrics">
   <td>When you’re sure you’ve had e</td><td>nough of this </td><td>life, well </td><td>hang on</td>

There are additional <div> classes for chorus, comments, and so on. You can view the resultant HTML in a browser, and tools like weasyprint can be used to generate good looking PDF pages. The CSS provides styles for screen and print media.

I think this approach has a much greater future than trying to crap in all kinds of {commentfont} {commentsize} {tabfont} and so on.

What do you think?
I think the HTML approach is certainly interesting and would provide an excellent amount of flexibility with the formatting of files. As far as MS Pro, I could probably leverage the WebView component which can render a web page, and just provide it the file instead of needing to write my own renderer. One nice thing about the ChordPro format is that it's relatively simple to view and edit. Some users probably wouldn't like having to modify HTML. It would also probably mean that I wouldn't be able to provide settings to modify the way the file is displayed, as I wouldn't be rendering it myself. I would need to provide an editor of sorts for the HTML I suppose.

itsme - I will try to add support for all that, but it's going to be stuff you have to insert in the chord pro file itself (versus something you set in MobileSheets). In order to support all that, I'm either going to need to add support for tons of new directives, or I'm going to have to provide a directive that takes multiple inputs, such as which font type is being modified (lyrics, chords, tabs, etc), the color to use, the size, etc.
Mike, I suspect a little misunderstanding -- it's still the familiar ChordPro file that is maintained. The renderer converts it to HTML, and then uses a HTML renderer for the final result. Users would not edit the HTML directly, although they may need to edit the CSS (or supply a custom CSS). But a couple of standard CSS files would suffice for most needs, while the power users can change the CSS at will.
I understand, so I would need to implement the conversion from chord pro to HTML.
Only if you'd want to do formatting with extreme flexibility/customizability.
IMHO, the way MSPro currently handles formatting ChordPro files is sufficient for the purposes MSPro is intended for. MSPro is not a typesetter, it should format the songs for maximum readability on a tablet screen. Yes, it would be nice to have some additional settings for tab size and such but I don't think much more would be needed. Of course, users will ask for more, that's human Smile .
Just like nicely formatted PDF scores, with heading and footers and so on. With MSPro, you apply cropping to get rid of the frills and obtain maximum readability.
I really miss the feature to change the formatting of just a part of a line, e.g. make a single word within a lyrics line bold or underlined, highlight a certain chord or such. Could that css approach allow that without giving up compatibility to standard ChordPro?
Any plans by now to implement something like that?
Currently, there are no plans for in-line markup. It would be rather straightforward to add simple markdown-style markup for bold, underline and italic in the lyrics.
Highlighting individual chords would be harder.
But in any case I'd like to avoid ChordPro becoming some kind of bloated XML, and Chordii cs. becoming typesetter engines. Simplicity is the key.