font

CSS Font “Helvetica Neue”

匿名 (未验证) 提交于 2019-12-03 02:44:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I often see the websites using font "Helvetica Neue". Is this font safe to use, like eg. Arial? Or do the browsers have trouble rendering it or not many machines have this font? Thanks. 回答1: This font is not standard on all devices. It is installed by default on some Macs, but rarely on PCs and mobile devices. To use this font on all devices, use a @font-face declaration in your CSS to link to it on your domain if you wish to use it. @font-face { font-family: Delicious; src: url('Delicious-Roman.otf'); } @font-face { font-family: Delicious;

Center-/middle-align text with PIL?

匿名 (未验证) 提交于 2019-12-03 02:44:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How would I center-align (and middle-vertical-align) text when using PIL? 回答1: Use Draw.textsize method to calculate text size and re-calculate position accordingly. Here is an example: from PIL import Image, ImageDraw W, H = (300,200) msg = "hello" im = Image.new("RGBA",(W,H),"yellow") draw = ImageDraw.Draw(im) w, h = draw.textsize(msg) draw.text(((W-w)/2,(H-h)/2), msg, fill="black") im.save("hello.png", "PNG") and the result: 回答2: Here is some example code which uses textwrap to split a long line into pieces, and then uses the textsize

how to simplify font import in css

匿名 (未验证) 提交于 2019-12-03 02:42:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a font namely SourceSansPro, and I include it in my css as follows: @font-face { font-family: "SourceSansPro"; src: url("../font/SourceSansPro-Bold.otf"); font-weight: bold; font-style: normal; } @font-face { font-family: "SourceSansPro"; src: url("../font/SourceSansPro-Regular.otf"); font-weight: normal; font-style: normal; } @font-face { font-family: "SourceSansPro"; src: url("../font/SourceSansPro-Light.otf.otf"); font-weight: lighter; font-style: normal; } It's rather redundant. Isn't there a neater way to do this? 回答1:

RichTextBox font style button for Bold and/or Italic (how to code so more than one can be chosen instead of replacing

匿名 (未验证) 提交于 2019-12-03 02:41:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Right now I am using some buttons with the following code: richTextBox1.SelectionFont = new Font("Tahoma", 12, FontStyle.Bold); richTextBox1.SelectionColor = System.Drawing.Color.Red; I also want to add some buttons for Bold, Italic, etc using: richTextBox1.SelectionFont = new Font("Tahoma", 12, FontStyle.Italic); But if I have a Bold option, this code will remove the Bold and add Italic. How can I retain the Bold and Italic? Thanks! 回答1: What you really need to change both existing and coming text is this: if (richTextBox2.SelectionLength >

canvas scrolling issue tkinter

匿名 (未验证) 提交于 2019-12-03 02:41:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have begun working on this file and I am trying to get the canvas with the majority of the widgets to scroll, but it isn't working. I think the problem is in the definition of height, width, and scroll region. But I haven't been able to get anything to work when I play around with those numbers. Here is the code: from tkinter import * from tkinter import ttk from tkinter import filedialog def work_area(): #create GUI root = Tk() root.geometry("+800+300") root.title("FSCE Database") frame_main = ttk.Frame(root) frame_main.grid(column = 0,

PDFTextStripper parsing with wrong encoding

匿名 (未验证) 提交于 2019-12-03 02:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: PDFTextStripper stripper = new PDFText2HTML(encoding); String result = stripper.getText(document).trim(); result contains something like <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html><head><title>Inserat SeLe EE rev</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> <div style="page-break-before:always; page-break-after:always"><div><p>&#0;&#1;&#2;&#3;&#4;&#5;&#6;&#7;&#... instead of <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional

django file upload from json

匿名 (未验证) 提交于 2019-12-03 02:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Hi i have given the complete code for my file upload .But in my views i am just trying to return a response and get the alert on the UI.But none of the return statements are working.How to rectify this.. EDIT : i see the logging statements on the server side <h1>Add Content</h1> <form method="post" enctype="multipart/form-data" id="contentform" action="/content/savecontent/" >{% csrf_token %} <b> <table> <tr><td><font>*</font>Content Name</td><td> <input type="text" id="cname" name="cname" maxlength="30"/></td></tr> <tr><td><font>*</font

How to search for a specific font in a Word document with iterop

匿名 (未验证) 提交于 2019-12-03 02:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I use something like this: doc.Content.Find.Font.Name = "Times New Roman"; but when I step through the code the Name property doesn't change. thanks. I'm working with VS2010 and MS Word 2007 and I want to find and replace all "Times New Roman" fonts with "Arial". Here's what happens: Word.Application wordApp = new Word.Application(); Word.Documents docs = wordApp.Documents; doc = docs.Open(fileName, Visible: false); doc.Content.Find.ClearFormatting(); doc.Content.Find.Replacement.ClearFormatting(); // Here the value of Find.Font.Name and

How to apply font anti-alias effects in CSS? [duplicate]

匿名 (未验证) 提交于 2019-12-03 02:36:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This question already has an answer here: Forcing anti-aliasing using css: Is this a myth? 17 answers How can we apply Photoshop-like font anti-aliasing such as crisp, sharp, strong, smooth in CSS? Are these supported by all browsers? 回答1: here you go Sir :-) 1 .myElement{ -webkit-font-smoothing: antialiased; } 2 .myElement{ -webkit-text-shadow: rgba(0,0,0,.01) 0 0 1px; } Update: (see Duke) .myElement{ text-shadow: rgba(0,0,0,.01) 0 0 1px; } 回答2: Short answer: You can't. CSS does not have techniques which affect the rendering of fonts in the

jQuery $.post() + IE8

匿名 (未验证) 提交于 2019-12-03 02:35:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: <script type="text/javascript" src="/scripts/jquery-1.6.2.min.js"></script> <script type="text/javascript" src="/scripts/jquery.form.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#SendReply").click(function(){ $(".error").hide(); var hasError = false; var pathname = window.location.pathname; var random = Math.random(); var messageVal = $("#InquiryResponse").val(); if(messageVal == 'Type your response in this space ...') { $("#InquiryResponse").after('<span class="error"><br><br><font color="red">You forgot to