cjk

Detecting CJK characters in a string (C#)

十年热恋 提交于 2019-12-04 22:15:19
问题 I am using iTextSharp to generate a series of PDFs, using Open Sans as the default font. On occasion, names are inserted into the content of the PDFs. However my issue is that some of the names I need to insert contain CJK characters (stored in nvarchar columns in SQL Server), and as far as I know Open Sans does not support CJK characters at present. I need to keep using Open Sans as my default font, so ideally I would like to try and detect CJK characters in the strings being grabbed from

Awk: Characters-frequency from one text file?

穿精又带淫゛_ 提交于 2019-12-04 18:14:54
Given a multilangual .txt files such as: But where is Esope the holly Bastard But where is 생 지 옥 이 군 지 옥 이 지 옥 지 我 是 你 的 爸 爸 ! 爸 爸 ! ! ! 你 不 會 的 ! I counted space-separated words' word-frequency using this Awk function : $ awk '{a[$1]++}END{for(k in a)print a[k],k}' RS=" |\n" myfile.txt | sort Getting the elegant : 1 생 1 군 1 Bastard 1 Esope 1 holly 1 the 1 不 1 我 1 是 1 會 2 이 2 But 2 is 2 where 2 你 2 的 3 옥 4 지 4 爸 5 ! How to change it to count characters-frequency ? EDIT: For Characters-frequency, I used (@Sudo_O's answer): $ grep -o '\S' myfile.txt | awk '{a[$1]++}END{for(k in a)print a[k],k}'

C# application on Japanese Windows OS - Present Latin as Full-Width characters

强颜欢笑 提交于 2019-12-04 16:51:08
I have a C# winform application, that is installed on a Japanese windows 7. Some of the labels are presented with a very wide fonts, causing them to not mach the size of the from. After some research I was told it might be a half/full width issue. Has it any way to force all strings to be presented as Half width? For example, this part is not shown correctly: modelSizeLabel.Text = String.Format("X:{0:0.0},Y:{1:0.0},Z:{2:0.0} [{3}]", (Model.BBox.dx), (Model.BBox.dy), (Model.BBox.dz - Model.Sink), uc.To.ToString() //units enum ); Tetsuya Yamamoto Basically there are 2 approaches I know to deal

Rasterize PDF's with font not embedded using GhostScript

橙三吉。 提交于 2019-12-04 15:08:45
I need to generate JPEG's from PDF. JPEG must be created based on Trim Box and PDF's can be version 1.3 with extra Pantone colors that absolutely require Overprint Preview so only GhostScript (and Rip's of course can handle them). Both Photoshop, Image Magick and SIPS (Scriptable Image Processing System of OS X) cannot solve both problems (Crop to trim and composite handling overprint). I created an app to rasterize the PDF I receive and all works good EXCEPT that some chinese PDF have one font not embedded. This font is Chinese STXiHei TrueType (CID) with encoding G8pc-EUC-H (info extracted

Italic Font not work for Chinese/Japanese/Korean on iOS 7

回眸只為那壹抹淺笑 提交于 2019-12-04 14:54:13
问题 I want to set Italic Font Style in UITextView, but Italic Font just not work for Chinese/Japanese/Korean on iOS 7.Could anyone help? 回答1: Because there are no italic styled Chinese fonts on iOS, you need to use affine transformation to slant the normal styled Chinese font. The code below gives a 15° slant to Heiti SC Medium : CGAffineTransform matrix = CGAffineTransformMake(1, 0, tanf(15 * (CGFloat)M_PI / 180), 1, 0, 0); UIFontDescriptor *desc = [UIFontDescriptor fontDescriptorWithName:@

Recognizing text as Simplified vs. Traditional Chinese

感情迁移 提交于 2019-12-04 08:42:15
问题 Given a block of text that's known to be Chinese and encoded in UTF-8, is there a way to determine if it's Simplified or Traditional? 回答1: I don't know if this will work, but I'd try using iconv to see if it will translate between the charsets correctly, comparing the results from the same conversion with //TRANSLIT and //IGNORE. If the two results match, then the charset conversion hasn't encountered any characters that fail to translate, so you should have a match. $test1 = iconv("UTF-8",

Newline control characters in multi-byte character sets

余生长醉 提交于 2019-12-04 03:46:21
问题 I have some Perl code that translates new-lines and line-feeds to a normalized form. The input text is Japanese, so that there will be multi-byte characters. Is it still possible to do this transformation on a byte-by-byte basis (which I think it currently does), or do I have to detect the character set and enable Unicode support? In other words, are the popular encodings (Shift-JIS, EUC-JP, UTF-8, ISO-2022-JP) using bytes as part of their character set that could be mistaken for ASCII

How do I insert Chinese characters into a SQLExpress text field?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 02:59:22
How do I insert Chinese characters into a SQLExpress text field? I'm using SQL Express from VS 2008. When I add Chinese characters, either via an import app I wrote or by pasting them in from the data view inside Visual Studio, they end up as question marks. Just add an 'N' before your text delimiter in the INSERT/UPDATE statement for fields of the nchar/nvarchar/ntext type: INSERT INTO myTable (myField1, myField2) VALUES (N'any chinese character',N'any arabic character') Be sure you made your column type nchar, nvarchar or ntext. So you can store Unicode. It is all rather well described here.

Adjust the vertical positioning of ruby text

独自空忆成欢 提交于 2019-12-04 01:20:42
问题 I'd like to use HTML <ruby> to mark up Japanese text with its pronunciation. However, I've found that at large font sizes, the baseline of the <rt> text is well above the top of the characters it's marking up. Here's an example which shows what I mean: ruby { font-size: 72pt; } <ruby>遅<rt>おそ</rt>い</ruby> For reference, this is how it appears in my current browser (Firefox on Linux), though I've seen similar behavior in other browsers: What I would like is to adjust the height of the ruby text

Where can I find a Free Chinese Handwritten Recognition engine for Android/IPhone?

ε祈祈猫儿з 提交于 2019-12-03 19:43:18
I am interested in developing something that will make use of Chinese handwritten recognition software on smart phones. Before I get started I wanted to check to see if there was any free (for open source and commercial applications) tools already developed for use. I've tried searching myself but I couldn't find any that stood out specifically for use on IPhone or Android. Are there any free to use (for commercial purposes included) engines/frameworks for Chinese Handwritten Recognition? If so, where can I find them? Thanks for your help. https://www.google.com/#hl=en&sa=X&ei=elAKT5DQKMP