• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
3.9.16 - sans-serif fonts default to serif
#16
On iOS, MSPro seems to ignore typeface* in font directives (everything seems to be rendered in a default serif typeface) but honors size. Silver lining: I can just leave all the font directives in place for use by e.g., txtmus or EasyABC. 

*in addition to my usual %%gchordfont Avenir-Book, I've tried Sans, sans, sans-serif, san-serif and Arial. Perhaps I'm missing something about the implementation.
Reply
#17
At the moment, if the font is not one of the keywords that MobileSheets is explicitly handling, it will use the default font for the platform. I can improve this handling a bit by trying to see if the font can be loaded by the OS, and if so, pass that font back into the SVG library to use. I should add that the abc library doesn't care about whether the font exists or not. I believe it just inserts the font name into the svg file that is produced, and it's up to the code handling the SVG parameters to correctly handle that font. So the code I need to update is actually the SVG code to try to load fonts specified in the SVG file, and only if I can't load those fonts should I be falling back to the platform default.

Mike
Reply
#18
Thanks for the explanation. 
Let me see if I understand correctly

At this time, MSPro is not passing font directives along to svg (but maybe the size is passed along?)
Therefore, the same font is used for all text in the render
The fonts currently available are those noted in the manual under Text File Settings
The font is chosen in Text File Settings 

Though it is not very important, I'm still confused about a couple of things 
1. Text is attractively displayed in a serif typeface, though the system font is (a less attractive) sans serif
2. On my system I can get to Text File Settings from the library screen. Tapping the "A" while the dots are displayed gives me a choice of edit or page size. 
3. Changing the Default Display to sans serif did not change the typeface in the render. 

These are things I can live with, I mention them in the hope that it might help you if you decide to address the issue.
Reply
#19
Well, that's not quite right. SVG files are just text files with drawing instructions. So a library has to be used to make sense of that and convert it into a rendered image. The library that is handling that determines how fonts are handled. Most of them provide a way for the application code to be a "font provider", so that when the SVG has the name of a font listed, it asks the application to provide the font for that name, otherwise it falls back to default behavior (which can be different on every platform and/or framework). I'm just not providing fonts for names that aren't recognized. I handle the most basic, standard fonts (serif, sans-serif, cursive and fantasy on Android, and monospace), but I'm not doing any font loading beyond that at the moment. The abc2svg library generates a svg file that contains font names like "text" and "music" which are not standard fonts. The "music" font is an embedded music font that has to be extracted from the base64 encoding (none of the Android, Windows or iOS SVG libraries even supported that, so I had to modify them to correctly handle embedded fonts), and "text" doesn't map to any standard font at all. So I handle "text" by using sans-serif. At the moment, I mapped sans-serif to a different font (Finale Maestro which is open source), but I'm going to go back to "Roboto" for that since it's a true sans-serif font, and I've just modified the Roboto font to insert sharp and flat symbols for those characters. 

Text File Settings don't apply to abc files, and if you have an abc segment in a ChordPro file, that doesn't change what font is used for the abc file or anything of that sort.

Mike
Reply




Users browsing this thread:
3 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2025 MyBB Group.