loading 3d text of different language other than English in A-frame - aframe

I've been working on my web VR project with A-frame, and I'm having a trouble with 3d text.
I'm trying to load Korean and Japanese text, but only numbers or alphabets were visible, and all the other texts in Korean and Japanese are not appearing.
I first thought it's because the basic fonts are all for English, so I used hiero to create custom font with Korean font and using it. > but still not working.
Can anybody guess what the problem is, and come up with a solution?

You'll need to create an MSDF version of the font you want to use. This GitHub repo has a large collection of fonts, but (currently) only in latin character sets. I would subscribe for updates on aframe-fonts#1 or try to build an MSDF font yourself to use Korean characters in A-Frame. I'm not familiar with creating those fonts, but generate.js or searching around may get some results. Best of luck!

Related

AvalonEdit - Syntax Highlighting - How do I add underline, change font size, etc?

I'm trying to build a basic, Markdown-style plain/rich text editor. (One where the text is styled inline, instead of having two panels side-by-side the way most Markdown editors do) (I'm also not going to support the full Markdown spec - no lists or tables, mainly just rich text formatting like bold, italics, underline, etc)
I have a project that consumes the AvalonEdit project (via the source code, not the Nuget package) - I got the editor all setup exactly how I want - then I started to write a syntax highlighting XSHD file when I realized that the highlighter only supports formatting like font colors, italics, bold, etc and not font size, underline and others...
How can I add additional font formatting? Will I have to write a whole new parser/highlighter/whatever? Is there an easy way to hook into and extend the existing highlighter?
I've already made a few small changes to one file in the source (TextEditor.xaml), and I'm willing to change more to make this work - though when I started I was hoping to touch the source as little as possible...
If someone could just point me in the right direction, I'd appreciate it - Thanks!
From the syntax highlighting documentation:
Among the text rendering extension points is the support for "visual
line transformers" that can change the display of a visual line after
it has been constructed by the "visual element generators". A useful
base class implementing IVisualLineTransformer for the purpose of
syntax highlighting is DocumentColorizingTransformer. Take a look at
that class' documentation to see how to write fully custom syntax
highlighters. This article only discusses the XML-driven built-in
highlighting engine.
Having read and/or scanned through that page a number of times, I couldn't fully grok this until I'd looked through the code a bit more, read some posts on the SharpDevelop forums, etc.
And if you're at the same stage I was (and can't quite wrap your head around that quote), the gist is that the editor does these two things (simplified, of course):
It generates lines of visible text (it only bothers with the lines
currently visible on the screen for performance reasons)
It then runs various transformers over said generated text, to style it in various ways
So the "XML-driven built-in highlighting engine" is only one way to find and style text - one that's meant to be a simple implementation of the more 'advanced' way, which is to build a custom text transformer, like a DocumentColorizingTransformer.
And here's some info on DocumentColorizingTransformer that you may find useful (besides the API documentation they point you to):
https://stackoverflow.com/a/23251990/859833
http://danielgrunwald.de/coding/AvalonEdit/rendering.php

Arabic text defaulting to default font

I have converted some open source ttfs from freearabicfonts.com into webfonts using fontsquirrel's webfont converter and gone through the usual css3 steps to get a webfont working (it's definitely there). However, when I try to use the font on arabic text it doesn't work.
background check:
db tables set to utf8, text saved in db as valid arabic, defaultcharset in htaccess set to utf-8, mysql connection: set names as utf-8 done, html5 meta tag set to utf-8, in view source the text is arabic, on the page, the text is arabic..... but the font is the ugly browser standard one...
Anyone ever seen this... I'm pulling my hair out...
Thanks very much indeed.
A
So after a LOT of reading, and bear in mind I am not an Arabic speaker/writer, here are my discoveries and solutions so far:
Currently, there are no solid ways of making Arabic webfonts via online font converters however I would imagine that this will change moving forward.
The options for arabic fonts are the following:
(1) You can use webfonts.fonts.com and their arabic fonts, this list is growing fairly quickly and as of writing this there are 35 font families (195 fonts) link here:
http://webfonts.fonts.com/en-US/Project/Choosefonts#languages%3DW20%26page%3D1
(2) If you have to use your font then you have to convert it yourself and beware, there be dragons down there... The way I font was to use fontforge which is available for unix, for mac you should get this via macports using sudo port install fontforge in the terminal. I think you can get it running in windows using cygwin too. You have to do a lot in the advanced export options to get a perfect result. There's simply too much to explain everything on this post. Instead I strongly recommend you skim read this to get a better grasp of output options from fontforge:
http://fontforge.sourceforge.net/overview.html
http://fontforge.sourceforge.net/gposgsub.html
it's all down to ligatures, glyphs & subsets, however I'm not sure i got mine right as I don't write arabic but mine seems to finally visually match things ok.
(3) As of writing this Google's free arabic webfonts are finished however look over here to track progress:
http://shashafont.com/
I'd really strongly recommend option 1.
Hope that helps someone
The font squirrell converter by default generates a fairly minimal font to keep the size small; any non-Latin characters are removed.
You have to enable some of the advanced options to maintain the arabic glyphs in the font: under "subsetting" choose "custom" or "no subsetting". I haven't actually tried it myself though.

How can I load dynamically typekit fonts?

Is there a way to load typekit fonts dynamically, much like the Google Font API?
That is, how can I declare dynamically on each page the font name in a css link and load just the font(s) that are required for that page, instead of adding fonts into a kit and the loading the whole kit.
I have found a solution, posting it here in case it is useful for someone else:
I will use the Typekit API to dynamically create a new 'kit' (i.e. javascript file) for every different combination that my app requires, instead of including all of them in one big 'kit'.
See: https://typekit.com/docs/api/kits
Thanks anyway for your answers!
You could write a server side script that, depending on the page, will generate a different css file with the font-family rule(s) you wish.
Then you could use #import to bring this rule into your main css file.
TypeKit has recently introduced a way that users may find useful to perform functionality similar to what you are looking for but doing it in a very easy way without having to use the API. They call it Dynamic Subsetting.
As I write this it is only available for East Asian Fonts, however, there is a workaround to use it with other TypeKit fonts. The workaround comes from this site.
Add a East Asian Font such as Source Han Sans Japanese. This will automatically convert the kit to a dynamic kit.
Select each font and under the Character Set options choose Dynamic Subsetting for each font.
Remove the East Asian Font.
Publish Kit.
Even if you remove the East Asian Font, the kit will remain a Dynamic Kit.

Multi-lingual Flex app - preferred fonts for embedding specific languages

I work on a collaboration web app, built with Flex 3, that needs to support multiple languages.
Does anyone know which fonts are best for creating embedded font libraries for Chinese, Korean, Japanese, and Russian languages? I know Arial Unicode MS will do the job, but I don't know if it will do the job best.
Localization alone won't solve the entire problem: chat input and display, for example, need to support multiple languages in the same textfield - anything typed in Chinese needs to display in Chinese; anything typed in English needs to display in English.
Using _sans is an option, but is far from preferred.
Thanks.
Went with an approach that switches TextFormat of characters based on unicode value. So, characters in the primary language display in the preferred (embedded) font, while characters in other languages display in _sans.
This works out really nicely, but requires that you inspect every character that is added to a field, and requires you to inspect everything when a deletion occurs. Kind of a lot of inspecting and I'm sure a textfield with a lot of content would start running into performance issues, but this is for a chat tool, so that isn't too critical of a use case.

Any way to build Google Docs like viewer for PDF files?

Does anyone think it is possible to build a Google Docs style PDF document viewer, which will convert a document to a format that doesn't require Adobe Reader on the client machine?
If so, any references to point to? Either a place that had done it, or an explanation of how to do it.
I've done a lot of research regarding this matter and I hope I can help.
Good old Macromedia used to market Flash Paper, which was supposed to be a PDF Adobe Reader killer as it allowed any webmaster to embed and display PDF docs online using Flash. But that was before they sold out to Adobe and Flash Paper was soon put on a shelf and forgotten in favor of Adobe's priorities.
However, Today there are a so many ground-breaking alternatives...
As a user has mentioned above you can use Scribd.com (the wanna-be YouTube for documents). But they're not the only service (and certainly not the ones most ahead of the curve).
Here are my two favorites:
Issuu (http://www.issuu.com)
Mygazines (http://www.mygazines.com/)
I enjoy Mygazines's flash user interface the most (it's also faster) but it costs $99. It's pretty impressive. Depending on what you want to do that price tag can be worth it.
Issuu however, has won me over recently with their Smartlook Platform: http://issuu.com/smartlook
Here's a sample of Smartlook setup on a website:
http://www.ismartlook.com/
Plus it's completely free, which is nice.
A third alternative, which I've considered using myself is this free and open source code made by this guy named samurajdata. He calls it psview (PostScript Viewer). Anyone can download the source code and see it in action here:
http://view.samurajdata.se/
The converted PDFs losses quality as it converts to image fie, but it's fast and easy to setup.
I hope this helps!
You may try Doconut.com looks pretty same as Google Docs viewer. It is available for asp.net 4.0, apart from PDF it can also show all office formats, tiff, dwg, psd etc.. However it is a paid library.
If I understand you correctly you only want to view these files and not edit them.
Google already makes a best effort at providing PDF files found in it's search results as HTML. This doesn't always work. You can try it out by setting up a gmail account, mailing all your PDF files to it, and then using all the "View attachment as HTML" links in the messages.
Your other options are to take the source material and make it into HTML as say LaTeX2HTML does for LaTeX documents, or to convert the PDF into one of: a raster image (tiff, DjVu, etc), or a vector image (PostScript, SVG, SWF).
If the input to this process starts with the PDF files, you have very limited options, especially if the contents of the PDFs are just raster images (say scanned pages).
Personally I'd advocate for creating the PDFs from their source and trying to use Flash Paper to create an SWF out of them too as Flash Paper will pretend to be a printer. Because some 98% of browsers have Flash 9 or greater.
Have you seen Scribd?
You can just use the Google Docs Viewer which also supports PDF documents. It allows you to embed it in your web page and point to the URL where the PDF is located (which doesn't have to be on the Google servers).
Example:
http://docs.google.com/viewer?embedded=true&url=http%3A%2F%2Fwww.domain.com%2Fdocument.pdf
There is the Internet Archive BookReader available. It's a nice book viewer implemented in javascript (jQuery), so the client doesn't need a PDF reader nor Flash. Though it needs images for the book pages, you can easily connect it to your own image server, so you may try to convert a PDF to images via ASP.NET (or any other tool like XPDF). I found that this is simpler to implement than actually implementing an images viewer.
Also, it seems to support search highlighting (try it here), but I haven't investigated exactly which metadata are needed and in what format.
The last release file contains a simple example on how to use it. More details and examples can be found in the first link.
Try converting them from PDF to TIFF. Tiff supports multiple pages and is widely supported.
If formatting isn't that important, and your PDFs are structured right (ie actually contain text, not images of text), an alternate could be to convert to HTML. The tools from Aspose are pretty good.
I'm wondering why you would want to do that. PDF is such a general and widely supported format that if you try to avoid it you're limited to:
A more obscure or less well supported format (dvi, svg until it gets better support)
Converting to text/HTML like Google does with less than perfect results
Converting to an image format like TIFF which bumps up file sizes and removes all the niceties of PDF like real, selectable text and hyperlinks
If you don't want your users to have to install Adobe Reader (understandable), there are many free lightweight PDF viewers available (Foxit Reader for example), I'm sure many of these have browser embedding capabilities.
Am I missing something here? Google Docs DOES support PDF. Simply upload the PDF file.
Some other alternatives depending upon what you're looking to do:
RAD PDF - ASP.NET component for displaying PDF documents, forms, etc. Also allows PDF searching, bookmarks, text selection, and basic editing.
Atalasoft - ASP.NET component for image viewing, but also allows PDF use as an image. Doesn't support any PDF features beyond simple viewing.

Resources