fonts

Obtaining the Width in Pixels of any given character

一笑奈何 提交于 2020-01-24 02:59:06
问题 I have this really awesome idea, but cannot find out if there are any classes in the .NET Framework (any version, preferrably 3.5 or 4.0) that allow you to pass in a character, and get back the width in pixels of that character, no matter which font, or font size or font-decoration is being used. Can someone please point me in the right direction? Does a class/something even exist for something like this? 回答1: Check out the Graphics.MeasureString method. Code sample adapted from the link:

how to use Calibri font in linux and mac

佐手、 提交于 2020-01-23 16:17:37
问题 My project have all its text in calibri my choice, its working perfect in Window o.s in all major browser, but when we try to deploy the same project on Linux or Mac the font style (font family,size)changes and take some other form, it looks weird. Its known that TTF(True Type Fonts) are made for all O.S. Till now, I got the copy paste method to copy the file of calibri from Windows to linux but its not worthful for me. I want it to be general not just for a particular system. 回答1: There is

Can't add custom font to Xcode

旧时模样 提交于 2020-01-23 12:34:48
问题 I'm trying to add a downloaded font to Xcode and I've folowed every single step based on this link: http://codewithchris.com/common-mistakes-with-adding-custom-fonts-to-your-ios-app/ I added the font to my Xcode Project, included it in Copy Bundle Resources (Build Phases), and typed it in Fonts Provided by Application (in Info.plist). Then I typed this in GameScene.swift inside didMoveToView It has worked with other fonts but not with this one. This is really frustrating me and I've got no

Can't add custom font to Xcode

女生的网名这么多〃 提交于 2020-01-23 12:34:10
问题 I'm trying to add a downloaded font to Xcode and I've folowed every single step based on this link: http://codewithchris.com/common-mistakes-with-adding-custom-fonts-to-your-ios-app/ I added the font to my Xcode Project, included it in Copy Bundle Resources (Build Phases), and typed it in Fonts Provided by Application (in Info.plist). Then I typed this in GameScene.swift inside didMoveToView It has worked with other fonts but not with this one. This is really frustrating me and I've got no

Java Locale Font question..?

安稳与你 提交于 2020-01-23 11:14:48
问题 [EDIT] this happend on OSX with Java 1.5! (but may also happen on Windows!) It seems japanese users of my Java Swing program cannot write japanese symbols in JTextFields. Actually they can write them but do not see them. They only see blocks which somehow indicates I think that the font does not support these symbols. I set my own font for various reasons ("Lucida Sans", Font.PLAIN, 12) - which I wouldn't like to change. My questions are: would the JTextFields show japanese Symbols without me

Obtain installed fonts as a list

早过忘川 提交于 2020-01-23 07:53:12
问题 is there any way I can obtain installed fonts as a list (or array, but I prefer a List). So like a method that will out all installed fonts to a list. I have so far created this List<string> fonts = new List<string>(); fonts.AddRange() //I don't know what to put in those brackets to obtain fonts. Can someone provide a better way? 回答1: You want the InstalledFontCollection class: using System.Drawing.Text; using (InstalledFontCollection fontsCollection = new InstalledFontCollection()) {

PHP: creating a smooth edged circle, image or font?

柔情痞子 提交于 2020-01-22 15:22:46
问题 I'm making a PHP image script that will create circles at a given radius. I used: <?php imagefilledellipse ( $image, $cx, $cy, $w, $h, $color ); ?> but hate the rough edges it produces. So I was thinking of making or using a circle font that I will output using: <?php imagettftext ( $image, $size, $angle, $x, $y, $color, 'fontfile.ttf', $text ); ?> So that the font will produce a circle that has a smooth edge. My problem is making the "font size" match the "radius size". Any ideas? Or maybe a

Xib taking long time (>1s) to load. UIFont cache seems to blame

北战南征 提交于 2020-01-22 13:53:29
问题 I have a UIVC loading from a Storyboard which, in turn, loads a Xib. This inner load is causing the VC to take more than a second to load. There is some fancy footwork going on in the inner xib (it loads another xib which has dynamic drawing) but this doesn't appear to be the bottleneck. According to Instruments, UIFont -initWithCoder is the culprit. (If you drill down further TBaseFont::CopyLocalizedName() is the deepest entry that accounts for the majority of the 1s time) I'm a bit stumped

Java Swing Font Chooser

China☆狼群 提交于 2020-01-22 10:49:19
问题 In my Java Swing application I want to allow the user to pick their font. To my surprise there is no core swing library to pick fonts. I expected to find a JFileChooser but there is no such utility. This seems like a simple dialog that I'm sure exists out there. I do not really want to write it myself. I looked around on the internet and found a few different implementations of this type of a dialog. The problem is most of them are on random blogs or are just code snippets. I am looking for

How to use SF Rounded font in SwiftUI?

陌路散爱 提交于 2020-01-21 19:03:34
问题 I am trying to use the SF rounded font in my SwiftUI project, how would you set it? I already tried messing around with the .font() but it didn't work (I wasn't able to set it to this rounded font) 回答1: Text("Your Text").font(.system(.body, design: .rounded)) 回答2: I know the question is about SwiftUI, but I thought it could be helpful to also include an UIKit answer. let fontSize: CGFloat = 24 // Here we get San Francisco with the desired weight let systemFont = UIFont.systemFont(ofSize: