fonts

Extract text from PDF in respect to formatting (font size, type etc)

陌路散爱 提交于 2020-01-13 06:58:21
问题 Is possible to extract text from PDF file in respect to specific font/font size/font color etc.? I prefer perl, python or *nix command line utilities. My goal is to extract all headlines from PDF file so I will have nice index of articles contained in single PDF. 回答1: Text and /font/font size/position (no color, as I checked) you can get from Ghostscript's txtwrite device (try -dTextFormat=0 | 1 options), as well as from mudraw's (MuPDF) with -tt option. Then parse XML-like output with e.g.

iOS - How to find the right font size (in points) with the same height as a given CGRect?

為{幸葍}努か 提交于 2020-01-13 00:30:09
问题 Heading pretty much explains it. I have an image that I'm drawing text on. I want the text to be sized according to the size of the image and want to find a way to get a height for the font that is just a little shorter than the image itself. 回答1: OK, so for everyone who thinks an iteration is not avoidable: NSString *string = @"The string to render"; CGRect rect = imageView.frame; UIFont *font = [UIFont fontWithSize:12.0]; // find the height of a 12.0pt font CGSize size = [string

In Win7 some fonts don't work like they did in Win2K/XP

眉间皱痕 提交于 2020-01-12 18:52:13
问题 My question is about how font handling needs to be changed in order to work correctly under Windows 7. I'm sure that I've made an assumption about something that was valid before, but is no longer valid. But I don't even know where to begin looking! I'm praying someone can help! Here are the details as I understand them (I've also posted this question on a Microsoft Windows Developers forum, but they're not answering): Yes, I'm behind the times (heck, I still write WIN32 code in plain C!) I

Set the same font for all component Java

感情迁移 提交于 2020-01-12 18:45:14
问题 I want to set a specific font for all component in a JPanel but I prefer that the question is still more general and not limited to the JPanel. How can I set the font to a list of component in a container (JFrame or JPanel)? 回答1: Here is a simple method that allows you to specify Font to the whole components tree under any Container (or just a simple Component, doesn't matter): public static void changeFont ( Component component, Font font ) { component.setFont ( font ); if ( component

Why Text is cutting from bottom in UITextField?

冷暖自知 提交于 2020-01-12 18:28:28
问题 I am using a custom font in my text fields and labels in my whole application. My font name is "digital-7.ttf". now the problem is that text in my labels is good but in the UITextFields it is cutting text from bottom. when textfield is editing then text is good but when editing is done then it cuts the text again. like this in this way i am setting its font style [txtFld setFont:[UIFont fontWithName:@"digital-7" size:25.0]]; and font has been added in info.plist Please help me 回答1: i just had

Why Text is cutting from bottom in UITextField?

萝らか妹 提交于 2020-01-12 18:28:17
问题 I am using a custom font in my text fields and labels in my whole application. My font name is "digital-7.ttf". now the problem is that text in my labels is good but in the UITextFields it is cutting text from bottom. when textfield is editing then text is good but when editing is done then it cuts the text again. like this in this way i am setting its font style [txtFld setFont:[UIFont fontWithName:@"digital-7" size:25.0]]; and font has been added in info.plist Please help me 回答1: i just had

Why Text is cutting from bottom in UITextField?

廉价感情. 提交于 2020-01-12 18:27:07
问题 I am using a custom font in my text fields and labels in my whole application. My font name is "digital-7.ttf". now the problem is that text in my labels is good but in the UITextFields it is cutting text from bottom. when textfield is editing then text is good but when editing is done then it cuts the text again. like this in this way i am setting its font style [txtFld setFont:[UIFont fontWithName:@"digital-7" size:25.0]]; and font has been added in info.plist Please help me 回答1: i just had

Change font in ggplot2 on Windows vs Mac

走远了吗. 提交于 2020-01-12 14:15:48
问题 I created a plot using ggplot2 on my mac. I changed the fonts to Times New Roman, which works fine. library(extrafont) ggplot(data=df)+ stat_density(aes(x=R1, colour="rho = -0,6"), adjust=4, lwd=0.65, geom="line", position="identity")+ stat_density(aes(x=R2, colour="rho = 0,6"), adjust=4, lwd=0.65, geom="line", position="identity")+ stat_density(aes(x=R3, colour="rho = 0"), adjust=4, lwd=0.65, linetype=2, geom="line", position="identity")+ xlim(-1, 1)+ xlab("Renditen")+ ylab("Dichte")+

Loading a font directly from a file in C#

假如想象 提交于 2020-01-12 14:03:51
问题 Is there a way to do something like this? FontFamily fontFamily = new FontFamily("C:/Projects/MyProj/free3of9.ttf"); I've tried a variety of variations and haven't been able to get it to work. UPDATE: This works: PrivateFontCollection collection = new PrivateFontCollection(); collection.AddFontFile(@"C:\Projects\MyProj\free3of9.ttf"); FontFamily fontFamily = new FontFamily("Free 3 of 9", collection); Font font = new Font(fontFamily, height); // Use the font with DrawString, etc. 回答1: This

How to set 2 fonts for HTML5 canvas context?

删除回忆录丶 提交于 2020-01-12 10:00:27
问题 I'm trying to get the Canvas to use two fonts when drawing text. This is because my main font is Comic Sans MS (It's a kids app). Since I can't find Comic Sans on iPad, I'm trying to substitute it with MarkerFelt-Thin. I've tried to use several variations of the following statement: ctx.font = "40pt MarkerFelt-Thin; 40pt Comic Sans MS"; Doesn't seem to be working. So at the moment I'm using user agent detection and manually assigning different fonts for each user agent. Anyone know the right