Why does body2 overrides body font size in material-ui? - material-ui

When specifying body2 styles it overrides body font size. Shouldn't it be a variant of Typography component?

Related

Getting Adjusted fontSize after Autoshrink in Swift

I am having trouble getting the font size of a label after the font autoshrinks to fit the width of the label bounds. Inside the user interface, I've set the Autoshrink capability to 'Minimum Font Size' of 9.0. The original font size is set at 17.0. Here is the method I used to get the fontSize:
labels.font.pointSize
However, even though the label has autoshrunk to say 12.0, the method still gives back 17.0.
Is there any other way to get the current 'autoshrunk' font size?

GWT - how to precisely set rendered width of TextArea in pixels?

I need to render a TextArea in an exact pixel width for the special purposes of my GUI.
When I set its width to "250px", it comes out as 256px.
Is there a way to override this behavior so I can render it as 250px exactly?
When you use setWidth(), you're effectively setting the element's content width.
To get the offset width use UIObject#getOffsetWidth(). This will return the width including padding and border (but not margins).
References on W3C
Computing widths and margins
The box model

Restrict Font Height in Emacs

I am using the default monospace font of Fedora 17 in Emacs (DejaVu Sans Mono). Unfortunately, the bold form of this font takes up more vertical space then the regular form. This means that whenever I type in text that becomes bold, all the lines on the screen move a little down. Similarly for when I highlight regions of text containing bold text.
Is there a way I can force EMACS to use exactly the same height for both the regular and bold forms of this (or any) font?

How can I create a UIFont with bold weight but not bold style?

In a UITableViewCellDefault style, the title font is a 20 point Helvetica normal-style font with a bold weight. How can I create this same font in code?
I was thinking about creating an instance of UITableViewCell and copy it's font, but I won't be able to change the point size.
I found this on SO:
Bold font with bold weight in iPhone
but I'm looking for a regular font with bold weight.
Any ideas?
If you refer to the font name itself you can create them like so by using a dash:
[UIFont fontWithName:#"Helvetica-Regular" size:12]

Question on CSS viewport width/height

I have 3 questions related to viewport;
Do document.documentElement.clientWidth and -Height always gives the viewport dimensions, regardless of the dimensions of the element ?
Can we both get and set width for the html element ? If yes, can this be done both using CSS and JS ?
Is there a CSS exception to the rule that "document.documentElement.clientWidth and -Height still gives the dimensions of the viewport, and not of the element "
it should always return the dimension of the viewport regardless of styles applied to the html element.
you can't set it. As this would require the browser-window to resize too. You can resize the window using JS but you shouldn't do that. You can change the height and width of the html element with css, but that doesn't change the clientWidth.
if you want to get the actual width of the html element use document.documentElement.offsetWidth
mobile is a bit of a different story.