fonts

Custom Fonts in Java

ⅰ亾dé卋堺 提交于 2020-01-11 02:26:11
问题 How to fix problem with custom fonts in Java? For example, my app uses font, that isn't on all computers. Can I somehow include it in compiled executable and then call it from there, if it doesn't exists on clients computer? What are other alternatives? I could make all fonts chars as images (before, in some graphics app) and then display image for each char... is it ok? 回答1: Here's an utility method I'm using to load a font file from a .ttf file (can be bundled): private static final Font

When should CSS font-family value use quotes? [duplicate]

梦想的初衷 提交于 2020-01-10 19:32:13
问题 This question already has answers here : Do I need to wrap quotes around font family names in CSS? (3 answers) Closed 6 years ago . When should the value for CSS 'font-family' have quotes around it? I've seen both font-family: arial and font-family: "arial" . As a specific example, I declare a font this way: @font-face { font-family: 'entypo'; font-style: normal; font-weight: 400; src: url('/css/fonts/entypo.woff') format('woff'); } What would be the correct CSS to have an element use this

How to convert TTF to FNT with Fontforge

為{幸葍}努か 提交于 2020-01-10 18:56:08
问题 I have a TTF font, that needs to be converted in FNT (and ideally in pcf too). I tried Fontforge, but when I loaded font and chose to generate font - nothing could be selected from the list on the right, except "No bitmap fonts" though there was WIN FNT. Can anyone help me with this? 回答1: FNT is a bitmap format while TTF is an outline/vector format. To get FNT output, you'll first need to create a bitmap strike or strikes. Fontforge can do this if it has been built with Freetype included: Go

Downsizing an .OTF font by removing glyphs

送分小仙女□ 提交于 2020-01-10 09:36:09
问题 I can't quite believe this question hasn't been asked specifically for OpenType fonts, but does anyone know of a way to remove glyphs from these fonts? I have an .OTF with a very large file-size (almost 10MB) and I need to make it smaller. The reasons are two fold. 1) I'm trying to prepare it for web embedding, so the smaller the files, the easier for the client. 2) Font Squirrel (used for easy preparation of font files) has a 2MB upload limit - I know there are alternatives, but none so far

Downsizing an .OTF font by removing glyphs

青春壹個敷衍的年華 提交于 2020-01-10 09:34:28
问题 I can't quite believe this question hasn't been asked specifically for OpenType fonts, but does anyone know of a way to remove glyphs from these fonts? I have an .OTF with a very large file-size (almost 10MB) and I need to make it smaller. The reasons are two fold. 1) I'm trying to prepare it for web embedding, so the smaller the files, the easier for the client. 2) Font Squirrel (used for easy preparation of font files) has a 2MB upload limit - I know there are alternatives, but none so far

Calculate Font Size to Fit Frame - Core Text - NSAttributedString - iOS

假如想象 提交于 2020-01-10 08:48:08
问题 I have some text which I am drawing into a fixed frame via an NSAttributedString (code below). At the moment I am hard coding the text size to 16. My question is, is there a way to calculate the best fit size for the text for the given frame ? - (void)drawText:(CGContextRef)contextP startX:(float)x startY:(float) y withText:(NSString *)standString { CGContextTranslateCTM(contextP, 0, (bottom-top)*2); CGContextScaleCTM(contextP, 1.0, -1.0); CGRect frameText = CGRectMake(1, 0, (right-left)*2,

Writing text with diacritic (“nikud”, vocalization marks) using PIL (Python Imaging Library)

只谈情不闲聊 提交于 2020-01-09 11:12:19
问题 Writing simple text on an image using PIL is easy. draw = ImageDraw.Draw(img) draw.text((10, y), text2, font=font, fill=forecolor ) However, when I try to write Hebrew punctuation marks (called "nikud" or ניקוד), the characters do not overlap as they should. (I would guess this question is relevant also to Arabic and other similar languages.) On supporting environment, these two words take up the same space/width (the below example depends on your system, hence the image): סֶפֶר ספר However

Writing text with diacritic (“nikud”, vocalization marks) using PIL (Python Imaging Library)

女生的网名这么多〃 提交于 2020-01-09 11:10:09
问题 Writing simple text on an image using PIL is easy. draw = ImageDraw.Draw(img) draw.text((10, y), text2, font=font, fill=forecolor ) However, when I try to write Hebrew punctuation marks (called "nikud" or ניקוד), the characters do not overlap as they should. (I would guess this question is relevant also to Arabic and other similar languages.) On supporting environment, these two words take up the same space/width (the below example depends on your system, hence the image): סֶפֶר ספר However

@font-face and letter-spacing in webkit

喜你入骨 提交于 2020-01-09 10:33:09
问题 I just discovered that letter-spacing doesn't always work in webkit (and perhaps other browsers?) when embedding fonts. I've tried it on two different fonts and received different results. "League Gothic Regular" will work http://www.theleagueofmoveabletype.com/fonts/7-league-gothic "Quicksand Light" will not http://www.fontsquirrel.com/fonts/Quicksand What's the skinny? Is there a way to force the hand of non-compliant fonts? Quick note: Firefox does seem to apply to both fonts. 回答1: I'm not

Cant find custom font - iOS

泄露秘密 提交于 2020-01-09 09:44:15
问题 i have added a custom font - one which i have downloaded from from the net. it is in TTF format and can be used on other programs on my mac. (Successfully added it to font book and used in fireworks). I have added the key to the info .plist but the font doesn't seem to work. When i NSLog the font it is null so i am assuming it isn't finding it. The TTF is called LONDON__.TTF but has a name as London font. What should i use as the font and add to the info.plist for this to work? Thanks Dan