font-size

Setting global font size in kivy

白昼怎懂夜的黑 提交于 2020-01-03 09:23:11
问题 What is the preferred way, whether through python or the kivy language, to set the global font size (i.e. for Buttons and Labels) in kivy? What is a good way to dynamically change the global font size setting in proportion to the size of the window? 回答1: Use a template to create your custom Label: from kivy.app import App from kivy.lang import Builder from kivy.uix.widget import Widget from kivy.properties import ObjectProperty, NumericProperty kv = ''' [MyLabel@Label]: text: ctx.text if

css实现实心三角形

不羁的心 提交于 2020-01-03 08:37:15
1、html <body style="flex-direction: column; height: 600px;display: flex; justify-content: center; align-items: center;"> <!--向上的三角形--> <div class="up"></div></br> <!--向下的三角形--> <div class="down"></div></br> <!--向左的三角形--> <div class="left"></div></br> <!--向右的三角形--> <div class="right"></div> </body> 2、css /*想获取朝那边三角形,给相反的一边设置颜色,font-size: 0;line-height: 0;可以兼容ie6*/ .up { width: 0; height: 0; border-left: 20px solid transparent; border-right: 20px solid transparent; border-bottom: 20px solid #f00; font-size: 0; line-height: 0; } .down { width: 0; height: 0; border-left: 20px solid transparent;

android - convert dp to float

和自甴很熟 提交于 2020-01-02 05:59:47
问题 My font size is 12dp. I'm setting the font using TextPaint , since I'm using a span. The problem is the parameter that TextPaint accepts is in float. I'm wondering how can I convert 12 dp to float? 回答1: From android.content.res.Resources.getDimension(int id): float twelveDp = TypedValue.applyDimension( TypedValue.COMPLEX_UNIT_DIP, 12, mContext.getResources().getDisplayMetrics() ); 回答2: Try this: public static float dipToPixels(Context context, float dipValue){ DisplayMetrics metrics = context

C# 生成pdf文件客户端下载

て烟熏妆下的殇ゞ 提交于 2020-01-01 22:34:54
itextsharp.dll 下载: http://sourceforge.net/projects/itextsharp/ 程序需引用:itextsharp.dll,itextsharp.pdfa.dll,PresentationFramework.dll 本人使用的是一般处理程序来写的,废话不多说代码才是硬道理,使用插件定位图片,表格是使用html转的pdf 1 public void ProcessRequest(HttpContext context) 2 { 3 context.Response.Clear(); 4 context.Response.AddHeader("content-disposition", "attachment;filename=报价单.pdf"); 5 context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("UTF-8"); 6 context.Response.ContentType = "application/pdf"; 7 //文件临时存储路径 8 string filePath = System.AppDomain.CurrentDomain.BaseDirectory + "/PDF/" + System.DateTime.Now.ToString(

史上最强php生成pdf文件,html转pdf文件方法

≡放荡痞女 提交于 2020-01-01 21:07:11
*/ /*--> */ 史上最强php生成pdf文件,html转pdf文件方法 之前有个客户需要把一些html页面生成pdf文件,然后我就找一些用php把html页面围成pdf文件的类。方法是可谓是找了很多很多,什么html2pdf,pdflib,FPDF这些都试过了,但是都没有达到我要的求。 pdflib,FPDF这两个方法是需要编写程序去生成pdf的,就也是讲不支持直接把html页面转换成pdf;html2pdf这个虽然可以把html页面转换成pdf文件,但是它只能转换一般简单的html代码,如果你的html内容要的是通过后台新闻编辑器排版的那肯定不行的。 纠结了半天,什么百度,谷歌搜索都用了,搜索了半天,功夫不负有心人,终于找到一个非常好用的方法了,下面就隆重介绍。 它就是:wkhtmltopdf,wkhtmltopdf可以直接把任何一个可以在浏览器中浏览的网页直接转换成一个pdf,首先说明一下它不是一个php类,而是一个把html页面转换成pdf的一个软件,但是它并不是一个简单的桌面软件,而且它直接cmd批处理的。而且php有个shell_exec()函数。下面就一步一步介绍如何用php来让它生成pdf文件的方法。 一,下载并安装pdf 下载地址:http://code.google.com/p/wkhtmltopdf/downloads/list

H5移动端知识点总结

时间秒杀一切 提交于 2020-01-01 13:11:07
/*--> */ /*--> */ H5移动端知识点总结 阅读目录 移动开发基本知识点 calc基本用法 box-sizing的理解及使用 理解display:box的布局 理解flex布局 Flex布局兼容知识点总结 回到顶部 移动开发基本知识点 一. 使用rem作为单位 html { font-size: 100px; } @media(min-width: 320px) { html { font-size: 100px; } } @media(min-width: 360px) { html { font-size: 112.5px; } } @media(min-width: 400px) { html { font-size: 125px; } } @media(min-width: 640px) { html { font-size: 200px; } } 给手机设置100px的字体大小; 对于320px的手机匹配是100px, 其他手机都是等比例匹配; 因此设计稿上是多少像素的话,那么转换为rem的时候,rem = 设计稿的像素/100 即可; 二. 禁用a,button,input,optgroup,select,textarea 等标签背景变暗 在移动端使用a标签做按钮的时候或者文字连接的时候,点击按钮会出现一个 "暗色的"背景,比如如下代码: <a href=

R - change size of axis labels for corrplot

好久不见. 提交于 2019-12-31 21:35:13
问题 I am using the following with corrplo t: require("corrplot") ## needs the corrplot package corrplot(cor(lpp_axis1, lpp_axis2), method=c("number"), bg = "grey10", addgrid.col = "gray50", tl.offset = 2, tl.cex=2, tl.col = "black", col = colorRampPalette(c("yellow","green","navyblue"))(100)) This is created with a csv file available here. The graph is fine and I can adjust the cl labels all I want. I've tried adjusting the labels on x and y axis with no impact. I looked at changing mar - yet I

Ems to Pixel Conversion - Why 62.5% and not 6.25%?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-31 21:26:08
问题 I know that a lot of us are familiar with setting the font size on the body element in our CSS to 62.5%. This means that 1em will equal 10px and helps for keeping things pixel perfect but also allows for scaling of fonts. So wouldn't that mean that setting it to 6.25% would equate to 1em = 1px? Seems like an even simpler conversion rather than having to mess with decimals... Thanks guys! I'm quite aware of the em and it's history (design degree), but I'm sure others may find it helpful :) As

如何处理跨平台的自适应三

拟墨画扇 提交于 2019-12-31 13:25:23
相信大家在面试的过程中总会被问到如何处理自适应这样的相关问题,自适应其实就是根据视口的大小或者说用户平台的不同呈现出不同或相同的样式,有这么几种方案: 使用flexbox弹性布局的方法 固定一个某些宽度,使用一个模式,加上少许的媒体查询方案 使用 rem ---------------------------分------------割------------------------------------- 淘宝rem的例子 看看淘宝在不同分辨率下,呈现的效果: 淘宝的效果跟网易的效果其实是类似的,随着分辨率的变化,页面元素的尺寸和间距都相应变化,这是因为淘宝的尺寸也是使用了rem的原因。在介绍它的做法之前,先来了解一点关于viewport的知识,通常我们采用如下代码设置viewport: <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> 这样整个网页在设备内显示时的页面宽度就会等于设备逻辑像素大小,也就是device-width。这个device-width的计算公式为: 设备的物理分辨率/(devicePixelRatio * scale),在scale为1的情况下,device-width = 设备的物理分辨率

从网易与淘宝的font-size思考前端设计稿与工作流

亡梦爱人 提交于 2019-12-31 13:25:05
以下内容到分割线前是引用前端大牛的文章,方便大家理解博主内容 ): 从网易与淘宝的font-size思考前端设计稿与工作流 1. 简单问题简单解决 我觉得有些 web app并一定很复杂,比如拉勾网,你看看它的页面在iphone4,iphone6,ipad下的样子就知道了: 它的页面有一个特点,就是: 顶部与底部的bar不管分辨率怎么变,它的高度和位置都不变 中间每条招聘信息不管分辨率怎么变,招聘公司的图标等信息都位于条目的左边,薪资都位于右边 这种app是一种典型的弹性布局:关键元素高宽和位置都不变,只有容器元素在做伸缩变换。对于这类app,记住一个开发原则就好:文字流式,控件弹性,图片等比缩放。以图描述: 这个规则是一套基本的适配规则,对于这种简单app来说已经足够,同时它也是后面要说的rem布局的基础。另外对于拉勾这种app可能需要额外媒介查询对布局进行调整的就是小屏幕设备。举例来说,因为现在很多设计稿是根据iphone6的尺寸来的,而iphon6设备宽的逻辑的像素是375px,而iphone4的逻辑像素是320个像素,所以如果你根据设计稿做出来的东西,在iphone4里面可能显示不下,比如说拉钩网底部那个下载框,你对比看下就知道了,这是4: 这是6: via 6下面两边的间距比4多很多,说明拉勾对4肯定是做过适配的,从 代码 也可以证实这一点:原文来自:http:/