font-size

Adjusting Font Size to Fit, Paint.measureText returns too small a value

守給你的承諾、 提交于 2019-12-25 04:45:12
问题 I'm using the FontFitTextView that was posted in this other thread, but it isn't working exactly right for me. The measureText() call is returning a number that is obviously too small to display the string. When it runs through to find a font size that will allow the text to fit, the font size it settles on is still too big. I feel like there is some other kind of padding or margin or some other invisible that is contributing the math that makes up the width which is causing the discrepancy.

Python-Docx tables - way to change font?

元气小坏坏 提交于 2019-12-25 04:44:23
问题 I am using Python-Docx to allow users of my code to create tables. I would like to change the font size of the table. The cell value numbers are wrapping around in the table cells because the font is too large. I have searched the documentation and many forums without any luck so far. Am i correct in my assumption that only table styles can be changed, but not font sizes? I realize I could modify or create my own style, but that will not help other users of my code on other computers ((such

Changing font-size with jQuery css() function is crashing Chrome

Deadly 提交于 2019-12-25 02:16:04
问题 So I have this bit of code that works perfectly in FF and IE8, but it's crashing Chrome: while($('#movie-info .vote').height()>30) { $size = $('#movie-info .vote').css('font-size').replace('px',''); $('#movie-info .vote').css('font-size',($size-0.5)+'px'); } 回答1: I guess that happens because chrome doesn't allow font-size to go under a certain limit, but when font-size reaches the limit, height is still > 30..? I think you should avoid the for loop, and instead recalculate optimum font size

CSS: Disabling automatic rescaling of font-size on iPhone

岁酱吖の 提交于 2019-12-24 15:44:05
问题 As explained here, the Apple iPhone (i.e. Safari) rescales the font-size when the viewport changes (i.e. from portrait to landscape or vice versa). The accepted answer to that question says that, in order to disable this behaviour, one should add: -webkit-text-size-adjust: none; (Note: in other posts I've also seen '100%' instead of 'none', which may be preferable, but the distinction seems irrelevant here.) Accordingly, my main question is why, when I view the following HTML test-file on my

CSS Transform-origin Changing with font-size

拥有回忆 提交于 2019-12-24 12:43:50
问题 I have created a simple SVG animation where it animates on click using a simple CSS transition and transform (see here: http://jsfiddle.net/T9hsW/1/). I want the SVG to scale with the user's font-size so I sized it in ems. However, I noticed that if I increase the font-size of my browse using cmd-+ then when I click the SVG, the transform-origin appears to be the old transform origin, not the new one, even though I have used % to set the origin: svg { width: 4em; height: 4em; } .arrow,

Why does the <button> tag treat em differently from how a <div> does?

倖福魔咒の 提交于 2019-12-24 12:34:18
问题 I've noticed that <button> tags seem to be scaling em units from something other than the font-size. <div> tags aren't exhibiting this same behaviour. This happens across the latest versions of chrome, firefox & ie. They are both styled like this: button, div { width: 3rem; height: 3em; } See this fiddle for an example. If I size a div and a button both with a width of 3rem and height of 3em, I would expect them to be square, unless there is a font-size style affecting one of them, or an

CSS样式表引用方式

半世苍凉 提交于 2019-12-24 08:59:15
1、外 部文件引用 方式 ;(推荐使用) 2、使用@import引用外部 CSS 文件; 3、内部文档头 方式 也叫内嵌法调用; 4、直接插入式也叫行 内样式。 它们主要的差别在于它们规定的风格使用的范围不同:    一、外部文件引用 方式   外部文件引用 方式 即将CSS写成一个文件,在HTML文档头通过文件引用来进行风格控制。   也就是把写好的CSS 属性 的文件保存为文件扩展名为.CSS文件。   CSS文件的引用是在HTML的标记之间写下列语句: <link rel="stylesheet" href="CSS/test.CSS"> 如当前文件目录下有一CSS 文件名为myStyle.css,内容如下: P{ font-family:'宋体';   font-size:9pt;   color:blue; }   H2{ font-family:'宋体';   font-size:13pt;   color:red;   }   则在引用是,用下列语句: <link rel="stylesheet" href="CSS/test.CSS">  当然,你可以复制这句,然后改下引用文件的路径及文件名就可以了。   应用CSS文件的一个最大好处就是,你可以在每个HTML文件中引用这个文件,从而可使整个站点的HMTL文件在风格上保持一致,避免重复的CSS属性设置;   另外

Get font-size attribute from style property

烈酒焚心 提交于 2019-12-24 05:49:25
问题 I have a set of paragraph elements <p style="font-family:Tahoma; font-size:10.666666666666666; margin:0 0 0 0;"> <p style="font-family:Tahoma; font-size:10.666666666666666; margin:0 0 0 0;"> <p style="font-family:Tahoma; font-size:10.666666666666666; margin:0 0 0 0;"> <p style="font-family:Tahoma; font-size:10.666666666666666; margin:0 0 0 0;"> I have to write px after font size degree. I am unable to use my current code loop $(this).css("font-size") I can't use this because it shows me the

Media queries in em not affected by the base font size

ぃ、小莉子 提交于 2019-12-24 04:09:03
问题 I'm trying to understand why setting a different base font size doesn't affect the EM values for the media queries. They are acting as the default base font size is 16px, while the rest of the content reacts normally. Try it yourself: Media queries in PX: https://jsfiddle.net/sebtp/n8x0tuvq/5/ [OK] Media queries in EM: https://jsfiddle.net/sebtp/n8x0tuvq/7/ [NOT OK] Media queries in REM: https://jsfiddle.net/sebtp/n8x0tuvq/10/ [NOT OK] html { font-size: 62.5%; /*setting the base font size to

Media queries in em not affected by the base font size

余生颓废 提交于 2019-12-24 04:07:52
问题 I'm trying to understand why setting a different base font size doesn't affect the EM values for the media queries. They are acting as the default base font size is 16px, while the rest of the content reacts normally. Try it yourself: Media queries in PX: https://jsfiddle.net/sebtp/n8x0tuvq/5/ [OK] Media queries in EM: https://jsfiddle.net/sebtp/n8x0tuvq/7/ [NOT OK] Media queries in REM: https://jsfiddle.net/sebtp/n8x0tuvq/10/ [NOT OK] html { font-size: 62.5%; /*setting the base font size to