fonts

Properly render text with a given font in Python and accurately detect its boundaries

雨燕双飞 提交于 2019-12-29 01:09:17
问题 This might strike as something very simple, and I too thought it'd be, but it apparently isn't. I must've spent a week trying to make this work, but I for the love of me can't manage to do so. What I need I need to render any given string (only containing standard characters) with any given font (handwritten-like) in Python. The font must be loaded from a TTF file. I also need to be able to accurately detect its borders (get the exact start and end position of the text, vertically and

Properly render text with a given font in Python and accurately detect its boundaries

与世无争的帅哥 提交于 2019-12-29 01:08:29
问题 This might strike as something very simple, and I too thought it'd be, but it apparently isn't. I must've spent a week trying to make this work, but I for the love of me can't manage to do so. What I need I need to render any given string (only containing standard characters) with any given font (handwritten-like) in Python. The font must be loaded from a TTF file. I also need to be able to accurately detect its borders (get the exact start and end position of the text, vertically and

how to use punjabi font in the android application?

别等时光非礼了梦想. 提交于 2019-12-28 18:57:07
问题 hi i want to develop an application in which i Want to use punjabi text. But my emmulator does not show Punjabi text. Is there any api or something else so that my emulator can show the punjabi text or suggest me any other way to implement punjabi language in my application. Thanks in advance. 回答1: You can use custom TrueType fonts by copying the .ttf file into your projects's 'assets' folder. Then in your application you can use the font like this; final Typeface customF = Typeface

How to get Ghostscript to use embedded fonts in PDF

做~自己de王妃 提交于 2019-12-28 13:36:10
问题 gs -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dBATCH \ -sDEVICE=pdfwrite -sOutputFile=output.pdf input.pdf I'm using (trying anyway) to use Ghostscript to reduce my PDF file size. The command above looks like it works, it reduces file size greatly, but then several of the fields are garbled. As for as I can track it down, It's doing font substitution. IE, The same text = same garbled text. The fonts are embedded in the PDF when it gets to me. Additionally, I have tried to add

embedding a font in Java

此生再无相见时 提交于 2019-12-28 13:34:13
问题 I have a custom font I want to show off in a Java program where the user can view it without having to install it. Does anyone know how to do that? working solution I have implemented the following: font = java.awt.Font.createFont(java.awt.Font.TRUETYPE_FONT, new java.io.File(Clazz.class.getResource("/resources/segoescb.ttf").toURI())); font = font.deriveFont(11.0F); 回答1: I have never done it, but it seems like the methods you want are Importing the Font Font createFont(int fontFormat,

How to repair a PDF file and embed missing fonts

孤街醉人 提交于 2019-12-28 13:21:13
问题 I use pdftk to repair some failures in corrupted PDF files, but I faced another problem which is not fixed by pdftk (or at least I do not know how to do so). I have PDF files with text based on TrueType fonts, but the fonts have not been embedded during PDF creation. Now I want to embed the required fonts to the existing files. Is there a command-line tool (like pdftk ) to embed missing fonts by providing path to TTF files? 回答1: You can use Ghostscript to embed missing fonts. Run the command

MessageFormat header/footerFormat how to change Font for JTable printing

假装没事ソ 提交于 2019-12-28 06:35:52
问题 in relation to this thread I have a question if someone to know if is possible to override/change larger font (Font Type, Size, Color) for MessageFormat headerFormat comings with JTable.PrintMode or I must paint g2.drawString("my header/footer") and JTable#print() separatelly 回答1: As everybody already mentioned (while I was relaxing in vacation :-) - TablePrintable is tightly knitted for secrecy, no way to subclass, no way to configure the header/footer printing. The only option to hook is to

How to change android keyboard key font?

风流意气都作罢 提交于 2019-12-28 05:47:06
问题 How can I change the default font for keys of keyboard I am writing in android (Eclipse)? Thank you 回答1: One solution is to use keboardView.java instead of android.inputmethodservice.KeyboardView . You also need to change paint.setTypeface(Typeface.DEFAULT_BOLD) to paint.setTypeface(my font) and you must add attrs.xml to your project. 回答2: I found an answer : Implemented onDraw... @Override public void onDraw(Canvas canvas) { super.onDraw(canvas); try{ onBufferDraw(); }catch(Exception ex){ }

Certain fonts not showing up?

ε祈祈猫儿з 提交于 2019-12-28 02:39:11
问题 I have a list of font names in my app, which are all displayed in the font they represent. The following three do not work though: ArialRoundedMTBold ChalkboardSE-Bold TrebuchetMS-Bold Instead they display in the standard font. Any ideas why these might not be showing up? 回答1: How to configure a custom font To use a custom font (one not included in iOS) you have to edit your <appname>-Info.plist file and create a new UIAppFonts key with type array, where each element of the array is a String

Loading an external font via inline CSS

依然范特西╮ 提交于 2019-12-27 23:37:29
问题 Is it possible to load an external font via inline CSS? Note: I'm not talking about using an external CSS file with a @font-face definition, but rather something like the following: <h1 style="font-family:myfont; src:('http://example.com/font/myfont.tff')">test</h1> 回答1: Is it possible loading an external font with inline css? NOT with an external CSS file [....]. Yes, you can base64 encode a font or fonts as shown in this article from Stephen Scaff and drop them into a style block in your