font-size

iOS7 - Adjusting font size of multiline label to fit its frame

余生长醉 提交于 2019-12-10 21:58:48
问题 I need to fit a multiline attributed text in a UILabel's frame. Reading this thread How to adjust font size of label to fit the rectangle? I started from Niels' solution in order to work with attributed text. Here's the code: the 't' of 'prospect' is put in a new line, whereas I need the words not to be truncated; in this example I expect the font size to be reduced a little more in order to fit 'prospect in a single line. UILabel *myLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 180

Cairo font size in Knitr

主宰稳场 提交于 2019-12-10 21:02:51
问题 This question was migrated from TeX - LaTeX Stack Exchange because it can be answered on Stack Overflow. Migrated 6 years ago . I am trying to set the font size in a Cairo device, but the pointsize argument seems to set the size of the points in the plot, and not the font size. I have this MWE: \documentclass{article} \begin{document} <<setup>>= library(maptools) data(meuse) coordinates(meuse) <- c("x", "y") proj4string(meuse) <- CRS("+init=epsg:28992") @ <<fig1, dev='cairo_pdf', dev.args

JQuery之选择器转移

青春壹個敷衍的年華 提交于 2019-12-10 18:45:35
JQuery之选择器转移方法如下图: 代码实现: 1 <script src="JS/jquery-1.12.4.min.js"></script> 2 <script> 3 $(function(){ 4 var $div1 = $('#div1'); 5 $div1.prev().css({ 6 // 获取当前元素的上一个同级别的元素 7 'color':'red' 8 }); 9 $div1.prevAll().css({ 10 // 获取当前元素上面的所有同级别元素 11 'font-size' : '20px' 12 }); 13 $div1.next().css({ 14 // 获取当前元素的下一个同级别元素 15 'color':'blue' 16 }); 17 $div1.nextAll().css({ 18 // 获取当前元素下面的所有同级别元素 19 'font-size':'20px' 20 }); 21 }); 22 $(function(){ 23 var $div3 = $('#div3'); 24 $div3.parent().css({ 25 // 获取当前元素的父元素 26 'background':'red' 27 }); 28 $div3.parent().parent().css({ 29 // 获取当前元素的爷爷元素 30

javafx root -fx-font-size and em sizing

孤者浪人 提交于 2019-12-10 18:18:29
问题 I'm trying to resize my layout elements using a root font-size and 'em' values. It looks like whenever I "touch" the -fx-font-size attribute, the root's font size is being reset to the base value (1em = 12px). For the simple fxml: <BorderPane fx:id="mainStack" prefWidth="600" prefHeight="400" stylesheets="/style.css" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"> <left> <VBox fx:id="leftPane"> <Button text="btn1"></Button> <Button text="btn2" styleClass="textBigger"><

基础梳理之 标签默认样式及css reset

冷暖自知 提交于 2019-12-10 17:11:27
一、浏览器标签的一些默认样式 部分: body { margin : 8px ; line-height : 1.12 } h1 { font-size : 2em ; margin : .67em 0 } h2 { font-size : 1.5em ; margin : .75em 0 } h3 { font-size : 1.17em ; margin : .83em 0 } h4, p, blockquote, ul, fieldset, form, ol, dl, dir, menu { margin : 1.12em 0 } h5 { font-size : .83em ; margin : 1.5em 0 } h6 { font-size : .75em ; margin : 1.67em 0 } h1, h2, h3, h4, h5, h6, b,strong { font-weight : bolder } button, textarea, input, object, select { display : inline-block ; } big { font-size : 1.17em } small, sub, sup { font-size : .83em } sub { vertical-align : sub } /*定义sub元素默认为下标显示*/

why font-sizing vw not working in safari?

随声附和 提交于 2019-12-10 15:54:36
问题 I'm using vw as the unit for my font size, so that it will look nicely when resize the browser. However, when I browse it at Safari, the content run, anyone know how to solve it? thanks CSS .flatNav { background-image: url(../img/navBar.png); background-repeat: repeat-x; width: 90%; margin-right: auto; margin-left: auto; font-size: 0.8vw; height: 48px; position: relative; top: 28px; background-position: center; } .flatNav ul { list-style-type: none; height: 48px; width: 75%; margin-right: 1

Are preferred font sizes in Windows8 going to require a calculator?

荒凉一梦 提交于 2019-12-10 14:43:55
问题 While looking at some official Windows8/"Metro" material, I see this line of xaml: <TextBlock Text="Contoso Cookbook" FontFamily="Segoe UI" FontWeight="SemiLight" FontSize="26.667" /> What?!? A font size of 26.667? I realize this is 2/3rds of 40, and 5/6ths of 32, so maybe there's some conversion thing happening there, but is this going to be the preferred way of setting font sizes, and if so, what are the guidelines for coming up with these seemingly random sizes? 回答1: There are pre-defined

JTable change Column Font

不想你离开。 提交于 2019-12-10 14:13:41
问题 I'm making a table where I want to make the first column with a higher Font Size. For example in column 0 I want Font size of 30 and on columns 1-3 y want Font size of 13. Here's my code import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.io.*; import javax.swing.JFrame; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.table.DefaultTableModel; import javax.swing.table.*; public class kanji_list extends JFrame { kanji_list(){ JTable table

CSS: Understanding and adjusting leading / line-height of fonts

守給你的承諾、 提交于 2019-12-10 13:24:39
问题 A very similar question was asked here but the really answered sufficiently... The CSS line-height property controls the amount of white space above the letters. Making it bigger/smaller spaces rows of text farther/closer together. But if you set the line height to the exact same value as the font-size, the text will still have white space above them. So this DOESN'T quite work... div { height: 80px; } span { font-size : 80px; line-height : 80px; } <div> <span>Foo</span> </div> http:/

What's the difference between GC and FontData for getting font height?

懵懂的女人 提交于 2019-12-10 13:08:26
问题 This explains font metrics I think we can get "Font height" in SWT like these; GC gc = new GC(label); System.out.println( gc.textExtent(label.getText()) ); System.out.println( label.getFont().getFontData()[0].getHeight() ); Why this two outs aren't same? And which one is correct height for a string ? 回答1: GC#textExtent() returns extent in pixels , while FontData returns in font points . The units are different here. 回答2: Use FontMetrics.getHeight() to get height in pixels. FontMetrics