font-size

How to measure the pixel width of a digit in a given font / size (C#)

青春壹個敷衍的年華 提交于 2019-11-30 19:25:05
I am trying to calculate the pixel width of Excel columns, as described in this post , using the official formula from the OpenXML specification. However, in order to apply this formula, I need to know the Maximum Digit Width of the Normal font, which is the pixel width of the widest numeric digit. The OpenXML specification gives this example as a clarification: Using the Calibri font as an example, the maximum digit width of 11 point font size is 7 pixels (at 96 dpi). I have checked that this is correct by visually examining a Calibri 11-point digit and it is indeed 7 pixels wide. So, I am

rem

微笑、不失礼 提交于 2019-11-30 19:02:15
通过sass动态设置rem ex: js文件: let htmlWidth = document.documentElement.clientWidth || document.body.cilentWidth; // 获取视窗高度 let htmlDom = document.getElementsByTagName('html')[0]; htmlDom.style.fontSize = htmlWidth / 10 + 'px'; // console.log(htmlWidth,htmlWidth / 10); //动态修改font-size window.addEventListener('resize',()=>{ let htmlWidth = document.documentElement.clientWidth || document.body.cilentWidth; let htmlDom = document.getElementsByTagName('html')[0]; htmlDom.style.fontSize = htmlWidth / 10 + 'px'; }) 在vscode中编写sass文件: @function px2rem($px) { $rem:37.5px;/* 基准值iphon6 375/10 */ @return ($px /

Dynamically Resize Text Based on Container Width

余生颓废 提交于 2019-11-30 16:57:50
I'm working on a responsive design and I have some display <h3> tags that I would like to scale down when the width of the browser window is reduced. The initial setup, based on a width of 960px: The body font-size is set to 14px The font-size of the h3 tag is 40px The width of the containing div is 230px So here's what I worked out for the javascript/jQuery: $(window).resize(function(){ var containerSize = $('.container').width(); var textPercentage = 0.17391304347826086956521739130435; /* 40/230 */ var textRatio = containerSize * textPercentage; var textEms = textRatio / 14; $('.container h3

scss

淺唱寂寞╮ 提交于 2019-11-30 14:58:24
目录 1、回顾gulp的使用方法 2、sass语法 2.1 css的编译模式 2.2 sass介绍 2.3 如何使用scss 3、sass用法 3.1 安装 sass 模块 3.2 配置处理scss文件gulp的任务 4、学习scss 语法 4.1 学习scss的注释语句 4.2 变量 4.2.1 单值变量 4.2.2 scss做四则运算 4.2.3 多值变量 4.2.4 复杂变量 - 循环 4.3 scss嵌套 4.4 mixin 混入 4.5 扩展 / 继承 4.6 函数 4.7 条件判断 4.8 导入另一个scss文件 1、回顾gulp的使用方法 2、sass语法 2.1 css的编译模式 css --- 普通 sass / scss --- 高效 // ********* less --- 高效 2.2 sass介绍 来源: ruby语言 基础的版本,后缀名为sass:没有{},只能通过缩进来实现 -- 可读性差、难以维护 // css .box {width: 100px} // .sass .box width: 100px; // 据说是这样 .scss 后缀 --- 可读性高、便于维护 html { background: red } // scss语法--嵌套 --- 权重 .box { color: blue; .test { font-size: 20px;

What does “a” stand for in font: 0/0 a;

眉间皱痕 提交于 2019-11-30 14:31:21
问题 I was referring a video tutorial where the designer used font: 0/0 a; for image replacement, so I get that 0 is the font-size , another 0 is the line-height but designer skips the a part just by saying that's an hack. So what does that a exactly do there? 回答1: http://nicolasgallagher.com/another-css-image-replacement-technique/ font:0/0 a – a shorthand property that zeros out the font size and line-height. The a value acts as a very short font-family (an idea taken from the BEM implementation

Java Swing - How to change the font size on a JPanel's TitledBorder?

↘锁芯ラ 提交于 2019-11-30 14:30:46
I need to be able to programmatically change the font size of all the components in my Swing app. I cannot do this in the usual ways (with UIManager or putClientProperty) as I am using the Nimbus look and feel, so am using the following method to increase the font size of each component in my app individually... private void enlargeFont(java.awt.Component c, float factor) { c.setFont(c.getFont().deriveFont(c.getFont().getSize() * factor)); } The problem I'm having is that I am using a TitledBorder on my JPanel and (predictably) passing my JPanel into the above method doesn't resize the JPanel

Java - FontMetrics without Graphics

血红的双手。 提交于 2019-11-30 14:28:22
问题 How to get FontMetrics without use Graphics ? I want to get FontMetrics in constructor, now I do this way: BufferedImage bi = new BufferedImage(5, 5, BufferedImage.TYPE_INT_RGB); FontMetrics fm = bi.getGraphics().getFontMetrics(font); int width = fm.stringWidth(pattern); int height = fm.getHeight(); 回答1: Hmm... It is quite logical that you need graphics to get FontMetrics. Font height, width etc. can differ on various displays. If you have some Component, you can use it for getting

Can I change the size of the Xcode IDE fonts?

大城市里の小女人 提交于 2019-11-30 13:51:13
I'd like to change the font size of the "Groups & Files" panel of the Xcode IDE. I know how to change the "Fonts & Colors" in the preferences, but those (seem to) only affect the code window, not the rest of the IDE. Any ideas? Thanks! I believe you can change the size of the Groups & Files pane by setting the PBXTableFontSize parameter in ~Library/Preferences/com.apple.Xcode.plist . This needs PBXTableFont to be set first to take effect. 1) Run defaults write com.apple.Xcode PBXTableFontSize 20 in Terminal, substituting 20 for whatever value you wish to use. 2) Run defaults write com.apple

How to change font size of Panorama item header?

▼魔方 西西 提交于 2019-11-30 13:17:25
What is the easiest way to set the font size of the panorama item header once so it can be used for all item headers in my app? There isn't a way to automatically do it for all headers in your app yet. You'll need to set the style for each one. Implicit styling is coming in the Mango update and that should allow this to be done then. Update Here's what you can do now. Create a global template style for the FontSzie you want. Something like: <Application.Resources> <DataTemplate x:Key="MyItemHeaderTemplate"> <Grid> <ContentPresenter> <TextBlock Text="{Binding}" FontSize="20" /> <

Change default font type/size in TinyMCE

橙三吉。 提交于 2019-11-30 11:38:13
How do you change the default font type and font size in TinyMCE? I'm using the advanced skin and I've changed the body, td, pre style in default/content.css but it still doesn't change. Well, there are several content.css and only one is used to style your editor depending on your configuration settings . You should use the content_css configuration option and name an own css file where you can overwrite the editors defaults (the content.css you were recently looking for). In your init function use something like content_css: "http://localhost/css/my_tiny_styles.css", and in my_tiny_styles