Convert Hiragino-Sans-GB-W3 to others font format - font-face

I had this two fonts called
-Hiragino-Sans-GB-W3.otf (12.5mb)
-Hiragino-Sans-GB-W6.otf (12.6mb)
but I had try many font convertor,
they didn't support it because the font size too big.
Is there any way to make it convert to others format?
Thanks.

You would need to strip all the unneeded characters and features from your font so its size get more manageable.
Of course, you have to be sure you’re legally allowed to do so.

Have you tried convert your font throught https://onlinefontconverter.com?
It has no size limit, but will fail if it takes longer than 30s to give a response after it has been completely uploaded. since its a big file, try to convert it to only 1 format at the time

Related

Ghostscript - Indentation of postscript code

Is there an option for to me to ask Ghostscript to indent the Postscript it creates?
Everything starts at the beginning of a line and I find it difficult to follow.
Alternatively, I am using Emacs and ps-mode.
If anyone know how to indent code in this mode I would appreciate a tip (apologize because this may not be relevant to this StackExchange)
No, there is no option for indenting the output.
PostScript is pretty much regarded as a write-only language anyway, and the output of ps2write (which is what I assume you are using though you don't say) is particularly difficult since it fundamentally outputs PDF syntax with a PostScript program on the front to parse it into PostScript operations.
Why do you want to read it ?
[EDIT]
You can always edit your question, you don't need to post a new answer.
I'm afraid what you want to do isn't as simple as you might think.
It might be possible for this use case if the PDF files you receive are always created the same way, but there are significant problems.
The font you use as a substitute for the missing font must be encoded the same way. Say for example the font in the PDF file is encoded so that 0x41 is 'A', you need to make sure that the replacement font is also encoded so that 0x41 is an 'A'. So just the findfont, scalefont, setfont sequence is not always going to be sufficient, sometimes you will need to re-encode the font.
CIDFonts will be a major stumbling block. Firstly because ps2write simply doesn't emit CIDFonts at all. These were not part of level 2 PostScript. As a result all text in a CIDFont will be embedded as bitmaps. If your original file doesn't contain the CIDFont then you'll get the fallback CIDFont bitmapped.
Secondly CIDFonts can use multiple-byte character codes, of variable length. You can't simply replace a CIDFont with a Font, it just won't work.
The best solution, obviously, is to have the PDF files created with the fonts required embedded. This is best practice. If you can't get that, then I'd suggest that rather than trying to hand edit PostScript, you use the fontmap.GS and cidfmap files which Ghostscript uses to find font.
Ghostscript already has a load of code to do font substitution automatically, using both Fonts and CIDFonts as substitutes, and it does all the hard work of re-encoding the fonts or building CMaps as required. If you are on Windows much of this may already be done for you, when you install Ghostscript it will ask if you want to create font mappings. If you said yes then it will
Add the font substitutions you want to use in those files (they have comments explaining the layout) and then use the pdfwrite device to make a new PDF file. Set EmbedAllFonts to true (you may need to add a AlwayEmbed font array as well, listing the fonts specifically) and SubsetFonts to false.
That should create a new PDF file where the missing fonts have been replaced by your defined substitutes, those substitutes will have been embedded in the new PDF file and they have will not been subset (Acrobat will generally refuse to edit text in a subset font).
The switches I mentioned above are standard Adobe Distiller parameters, but they are documented for pdfwrite here. There's some documentation on adding fonts here and here and specifically for CIDFonts here.
Basically I'd suggest you define your substitutions and let Ghostscript do the work for you.
This is not an answer to the problem but rather an answer to KenS's question about "Why do you want to read it?"
I tried to put it in the comment box but it was too long.
I am a retired engineer with a strong programming background.
I would like to read and understand the postscript code for the reason shown below.
I play duplicate bridge as a hobby. I recieve a PDF file of what is know as a convention card (a single page document of bridge agreements).
Frequently I would like to edit these files.
When I open with Adobe Illustrator I have to spend a significant amount of time replacing fonts that are not on my system with fonts that I do have.
I can take the PDF and export it as a postscript file using Ghostscript.
I was going to write a little program to replace the embedded fonts with the fonts that I use to replace them.
I was going to leave the postscript file unaltered and insert things like
/HelveticaMonospacedPro-RG findfont
12 scalefont setfont
just above where the text is written.
I was planning on using the fonts that I have on my system (e.g., HelveticaMonospacedPro-RG).

Terminal: UTF8 chars "overlapping" even with fixed width font

I was doing a visualization in this years adventofcode. My first stab just used plain ascii chars video here. Then I saw this image
Which I thought was really nice. However, when I attempted to put in these chars, they completely overlapped.
Is there a nice way to do this? I've tried installing gnu unifont as that sounded like a decent start, but no joy.
How do I use the terminal to print "letters" like this and have them come out nicely? I might be missing something fundamental about terminals + UTF8. If it matters, I'm using OSX terminal app, Anonymice Powerline Nerd Font Complete Mono font.
EDIT
Yes, the font didn't contain items which were encoded correctly (or was falling back?! if that's even possible, to items which weren't encoded correctly)
I ended up using the symbola font which, while not perfect, means I can draw this:
which is good enough!
It looks as if the "patched font" didn't set the font metrics properly. Terminals expect the font header to give a bounding box which applies to all characters. If the individual glyphs don't fall into the box, you'll get interesting effects like this.

How to Get font descriptors - CapHeight, Ascent, Descent, Flags, ItalicAngle, StemV of TTF Font

I am trying to create my own tool for creating the pdf file. Every thing is going well, Only thing I miss is the font descriptors. Kindly let me know the correct values of capheight, ascent, descent, glag, italic angle from afm/pfa/pfb or any tool available to genrate the same
Fontographer will show those values. A bit pricey for just collecting statistics. My copy is old, back when Macromedia owned it. FontLab does now. See http://www.fontlab.com/font-editor/fontographer/

Changing Font Size of Japanese (Unicode) characters

I have a NSPopUpButton which contains either English or Japanese Strings read from a plist file according to the System's Language. Now when the Language is English I am able to change the font size by using code such as -
[auxStatePopup setFont: [NSFont fontWithName:#"Helvetica-BoldOblique" size:10.0]];
but Using such technique I am not able to change Japanese font size even if I tried by setting some Japanese font name which I googled and found out.
I want to do that because Japanese characters move slightly up when used. I intend to manipulate that upward movement by decreasing font size.
Thanks for any help..
OR
any way to move text in NSPopupButton downwards?
My impression is that the two samples are not using the same font. Please try to put a text with characters from both sets and see what happens.
Also try not to customize the font size and even the font face.
I also suspect that the text rendering engine may had overridden some of your changes due to the text length. iOS text rendering may try to change the font size of letter spacing if the text does not fit the control. So make some tests with shorter texts.
BTW, I think that you were mean to say that you want bigger font size for Japanese not smaller. In the screenshots the Japanese text is already too small to be properly read by anyone.

CGImageGetWidth returns different size then actual image

Hi i have a lot of image reading in my app and when I load the files i use
CGImageGetWidth and CGImageGetHeight to get the sizes of the images.
However this does not seem to return the right values all the time.
For example if I have an image whose size is 114x14, these functions will return 126x22 or something random like that.
The really odd part is that it doesn't happen all the time(changes from build to build) but it tends to happen to the same group of images.
So either i have some kind of coding error that i am not aware of or the images have some setting to them that makes them handle differently.
Anybody know of what could possibly cause this kind of behavior?
Thanks
Check the resolution of the image. Some image formats allow for a pixels-per-inch of something other than the standard 72 pixels per inch.

Resources