Add library font preference.#422
Conversation
|
Doesn't really deserve a PR but I would appreciate a quick check on Linux and Windows. Works fine on Mac. |
|
on ubuntu the font changes, but the size of the font doesn't. (The row height does change) |
😫 why is life so hard. the row height changes in response to the font change? I guess that means that the problem lies somewhere in the widget font handling not the font system. Can you disable the style sheet for your skin and see if that does anything? On OS X having a stylesheet at all seems to disable the parent-child inheritance of fonts which is part of why this stupid PR is 762 changed lines. |
Oh -- it's probably the LateNight CSS. Try removing all the font styling for the sidebar and track table -- it takes precedence over QWidget::setFont. |
|
bpm column is still not changing font even though I think I removed everything from my style.qss |
|
added a PR for the changes I made |
This is also with Deere on OSX, probably related https://bugs.launchpad.net/mixxx/+bug/1201079 |
I think in general we have problems theming custom widgets |
|
Mixed feelings about having different fonts in library and decks, but definitely like the possibility to change font(sizes). Maybe we should just ship with a good royalty free font , like |
|
it might be worth bundling fonts for skins, since I'm pixel-fucking a lot and a slightly different font could mess things up. But people like stupid customization, and if we can resolve the problem of the bpm widget not getting the theme I'd like to allow people to change the library font. Some blind users may want a huge font, and other users may want a teeny tiny font |
Absolutely, the idea was to bundle a default font to go with, so that we have a consistent default experience on all platforms. Currently, you have to go the css trial and error route to find a font class that at least look similar to the intended result. If the user later feels the urge to look at comic sans in the library, fine. |
|
Ok -- sounds good. I'll add a res/fonts folder and include Open Sans. It'd also be nice if we had a nice bitmap / blocky font like Deere uses for buttons -- that way the buttons could be drawn with overlay text instead of text being in the image. @esbrandt what font did you use for that in Deere? |
Drew some myself, some from a font ( dunno the name, may look it up in a backup). There are some usable ones out there, like What if we build our own? We already have a bunch of icons as svg, we could easily convert them to be in a font. Lets write down the requirements, and i`ll give it a go.
Later... Oh wait, basically all related controls in controllerpickermenu. I can start with the most needed though. |
|
I think we should svg icons as-is, not try to convert them to a font. Fonts are much harder to work with As for creating our own font, won't we quickly run in to issues with translations? |
No, because there is no translatable content. If you don`t like to use the font, you can always use your single svg icons in skins. So far I have created a |
|
What is the point of creating a font for pictograms/icons? Why not just svg files? |
So far we haven't translated words that were baked into the graphics like LOOP and CUE. I don't think we should either since space is really constrained and we often want to tweak it to look just right. |
For example -- beatloop buttons. I don't want to hand-design a "1 | 8" SVG, a "1 | 4" SVG, a "1 | 2" SVG, etc. I should just be able to set the text in the skin with a The downside of embedding them in the font is that your normal SVG editing tools may not work as well, and you may not be able to use SVG variables added in #302. There's no cost to providing both options to the skin designer here. |
|
Hm, though editing skins with the pictogram fonts may be confusing because the |
I have no problem with a standard font that represents standard text, but I think jus is talking about a "vinyl spinny icon" text object, or a "keylock icon" letter. That's what I think is a bad idea (due to difficulty editing font files and the confusion you mention between XML file and appearance) |
|
(some fractions already have code points btw: http://www.fileformat.info/info/unicode/block/number_forms/list.htm) |
I'm inclined to let @esbrandt use whatever workflow works best for skin designing. Perhaps he has a font tool that makes this easier than the standalone SVGs? If we're already adding custom font support then it's up to the skinner if they want to use a font or an SVG. |
|
I want to make sure that we're not locked in to a font that can't be edited with free tools. I don't even know what I'd use to edit a font on linux |
|
@ywwg For Modular, I used http://fontforge.github.io/en-US/ (available in the repos) to increase the size of the font. |
So as I understand it, the problem is we want a series of graphics available to any skin without duplicating the files? @rryan points out that we can put shared graphics in res/images and they are accessible from all skins by ":images/foo.svg". So we can have mixxx-wide graphics easily, like :images/keylock.svg without trying to install a font. I am trying to make sure I understand what problem there is that a font is a solution for. |
|
No - i dont want to push for using an icon font exclusively.
Q: Are we locked in to a font that can't be edited with free tools? Q: Aren't pictogram fonts confusing because the node in the XML will not match up with what's displayed? Q: So, whats the deal with icon fonts again? The whole font thing only makes sense if the Mixxx icon font is installed on the user machine by default. If we can`t agree to that, we can save our time and stop here. It's ok. |
I think we shouldn't install a font on the user's machine. My plan was to stick Mixxx standard fonts (Open Sans, a bitmap/blocky font, etc.) in res/fonts and then load them at bootup with QFontDatabase so that Mixxx can use them. I don't think we have a cross-platform way of installing the font (plus I'm not keen on dealing with the headaches of writing one :) ) and the user may not have permission to do that, etc. |
This option was not known to me. An icon font would be no other than loading Open Sans, it is just another font. Anyway. |
Seems like a nice benefit -- you can easily tweak/transform to your liking with CSS once there's a font. Qt CSS is not modern CSS though so a lot of the fanciness you can do with a real CSS implementation may not be available.
Nice, though if we're keeping a TTF file in sync between the manual and website then it's not that much work to keep a folder of SVG files in sync instead. |
|
One other thing -- "General wisdom" about QSvgRenderer is that it's somewhat inefficient -- most people render it to a pixmap first when they learn the dimensions they need. (I have not figured out how to do this in a way that does not make them really ugly under rotation -- since we rotate them in WKnobComposed -- we could add a Paintable flag that disables it specifically for WKnobComposed if it turns out to be a problem). The system font rendering machinery will likely be more efficient at beziers and vector art since text rendering is ubiquitous. Just a hunch -- obviously I would not make the decision to use a font based on this without some numbers. |
Conflicts: res/skins/LateNight/style.qss
b3a9dc9 to
464af2a
Compare
Reduced all point sizes by 1. Not sure why but Open Sans renders a tiny bit larger?
|
Added Open Sans and added a res/fonts folder that is included with the packages. At bootup we load fonts from the fonts folder -- the custom fonts are selectable from skin CSS and are also selectable from the Library font picker. I haven't added skin support for a |
|
It might help to have a short test that shows that the font can load as expected |
There was a problem hiding this comment.
I've had problems in the past debugging signals that are set up in one object that apply to another object and its slots. Although it's a little uglier to have a setupConnections() function in the target object, it helps to understand the construction flow.
There was a problem hiding this comment.
One of the benefits of signals/slots is that it lets you decouple components -- I agree it does make sense to explicitly couple them in some places (e.g. Library::bindWidget, Library::bindSidebar) for clarity. Making a setupConnections method explicitly couples the two -- perhaps unrelated -- objects.
Think of public slots as the public interface to the class (same as the public methods of a class). You have to look for call-sites to the public methods of a class to fully understand how it's used -- the same goes for signals/slots. I try not to connect to private slots from outside a class even though Qt will allow you too.
That means changing font sizes in the skin (artist, title...) from the preferences is not possible yet? I`m fine with that. We can now load OpenSans and predictable test font display on all platforms, that is awesome for its own. |
Yea, and I'm not sure changing the skin font is a good way to go since as @ywwg points out sometimes the UI might not generalize to any font size well. We can use Open Sans and any other font we drop in res/fonts via CSS. |
If the row height is smaller than the font-size the larger of the two is
used.