Does pixate/freestyle font-family changes font size as well? - pixate

When I set font-family for all labels, fonts are resized to some predefined size.
label{
font-family: "Verdana";
}
Is there a way to set font-family only and keep original font-size defined in storyboard file?

I've seen this issue as well, and I don't think there is currently a fix.
You might consider a few other options:
Instead of setting custom sizes on all those labels, add a Pixate styleClass instead. Then you can do whatever you want to customize the label style in your CSS.
If your font size is already set on specific labels in your Storyboard, then just use Verdana in the Storyboard's font selector and don't use Pixate: http://d.pr/i/PQcb
I hope that helps.

Looks like Pixate defaults to 16pt font-size. There is an issue open for that https://github.com/Pixate/pixate-freestyle-ios/issues/34.

Related

Sapui5 horizontal line

is there any alternative to the depricated"HorizontalDivider" in SAPUI5? Since Sap doesn´t mention any alternative, I ran over something like "" Element that draws a Horizontal line?
It is better that you use a toolbar element as it has the bottom border. When you use the html hr tag, it does not respect the theme color while the toolbar use the theme color and also its spacing policy.
<sap.m.Toolbar width="100%" height="1px"/>
It the following picture you can see what is the result of using a toolbar with 1px height.
And in the following picture the result of using html hr tag.
Or you can use any boxing elements of the UI5 and just play with its class. For example you can assign the class sapMTBStandard to your element to make a bottom border with suitable color in your theme.
<html:hr></html:hr>
Make sure you add xmlns:html="http://www.w3.org/1999/xhtml" library

how to set default font and font style in cocoa app?

My app has all different kind of NSViews, including NSTabView, NSButton, NSTextField, NSPopupButton and so on.
I would like to change all display text to a certain font and with certain font style.
is there anyway to set the default font and font style in cocoa app?
I have tried:
How to loop through subviews in order to get the text of NSTextViews
however it doesn't work with NSTabView and NSButton.
I think that there must be an easy to do so, it's just I don't know what it is.
Please advise.
There isn't a built in way to do this (ie. by setting a key in Info.plist). You really do need to go through all the controls in your app, one way or another, and set a custom font for them. There are a few possible approaches. One is to use a custom subclass for all the controls for which you need to use a custom font. The subclass can be really minimal, it just needs to set the correct font upon initialization, possibly preserving other font attributes (size, color, etc.) setup in Interface Builder. Another option is to do as you've suggested and go through each subview in your app, check to see if it responds to -setFont:, and set your custom font if it does. I've used the first approach (subclass) with good success.

How to adjust the font size of the UINavigationBar so that it fits the size of the titleView?

I like to use the default size of UINavigationBar.
However, sometimes the title is too long and I want the font size to get reduced appropiately.
How would I do so?
I suppose, first I need to find out the size of the titleView first. I think that can be done.
Then I need to call a function that will tell me the appropriate font size.
Then I would need to specify the font with that size WITHOUT changing the font name for that UINavigationBar.
Anyone knows how to do any of those (doesn't need to be all).
You need to set the titleTextAttributes property of the UINavigationBar. You can get the font size and font type from the same property and adjust or change the font size and font type depending on ur requirement.
Check out the documentation for more details on the same.
http://developer.apple.com/library/ios/#documentation/uikit/reference/UINavigationBar_Class/Reference/UINavigationBar.html

Xcode 4 Interface Building Font Not Updating/Showing

When I am changing the font of a label to anything other than the default, the label's font never changes. I can change the font size but not the displaying font. However, when I double click on the label, I can see what the label's font would look like. Can anyone help me with this?
Not all fonts are available on the iPhone. If you are setting the font to an unavailable one, it will default to helvetica. Search the net for a list of the fonts you can use.
You can reference http://iosfonts.com/ for fonts available for each version of iOS. Fonts outside this list will appear as Helvetica, as jrturton said.
I would suggest expanding the size of the text box, by dragging its outermost edges? Despite having made your changes if the selected font/font size combo is to large for the text box to handle it will remain smaller than what you selected even though when you go into the highlight view it appears correct
Edit
Just Because its in that font selection tool does not mean it will show up on the device

PyQt Scaling background image using styleSheet ? or any other way?

I'm trying to resize a background image on a button
btn.setStyleSheet("background-image: url(:/AddButton.png);"
"background-repeat: no-repeat;");
tried it with
background-size: 10px auto;
but pyqt seems to be missing this CSS attribute
Is there any other way of scaling the background image on the button?
I need the background image as the icon on the button will be used on top.
any suggestions?
I believe you need to use border-image. Since the border-image property provides an alternate background, it is not required to specify a background-image when border-image is specified. In the case when both of them are specified, the border-image draws over the background-image.