Display Mixed Complex Script in Text Editor via Harfbuzz & FreeType - text-editor

Some Background here:
I've downloaded this example and made it run on my Ubuntu. Everything's fine. I put my own OpenType font into the project and it works fine too! I made sure that HarfBuzz supports my font and my language.Now I need to go further.
I need some guide here:
In the above example,three kinds of language each has it's own font to support the display. I mean,these three languages is rendered separately(as to my understanding of the code).
So, how to make HarfBuzz to select the correct font when many kinds of language are mixed together and render them at once? I mean,without making a font file that supports all languages in the world.
In this example,Chinese script is vertically displayed(which is just as I want),but if I make the Latin script's text_directions to HB_DIRECTION_TTB,which is of course not what I want. I want the whole word 'LATIN' to rotated 90 degree.
So, how can I achieve that? how to make that happen without breaking anything about Chinese layout?
3 .Last but not least,after solving the above problems, I want to make a Text Editor to display and edit many languages at the same time,same place. I don't know if I have to do some work on HarfBuzz or FreeType or implement a text editor that supports this complex text layout? Is there any example that I can refer to ?
Thanks in advance for help.

HarfBuzz is doing shaping just on same script and directionality, you should first split your text, guess or find language and direction of that chunk (using ICU or smt else) then send it to a shaper. Generally on Linux for finding right installed font for a script, you can use fontconfig.
I do not know, I suggest making separate question for that.
Making a text editor starting from shaper is not easy task. You should do bidi, line wrapping and ... that all have their challenges. I suggest use higher level abstraction (pango). For instance browsers doing a lot to support these.

Related

Previewing and Typing in Unicode font (Private Area / Basic Multilingual Plane) in Linux for SMuFL

I would like to make a change to an open source Android app which uses the Bravura font implementing the Standard Music Font Layout (SMuFL) fonts. I am developing on Linux.
The app displays musical notes with things like
<string name="notef_c5"> == ==</string>
which is displayed like
I now need to change things and I would like to see what I am going to do, rather than semi-randomly changing the Unicode numbers and see what happens. So I installed the font on my Linux desktop from github, by simply copying the SVG that the app is using into my global font directory and that did not work (fc-cache said /usr/share/fonts/svg/Bravura: caching, new cache contents: 0 fonts, 0 dirs). The same procedure for the OTF did work. This could be a problem down the line, since the app is using slightly modified version of the SVG, so any hint on that could help, but it's secondary regarding the question.
In fact I want to use "something" to display the font, and I tried many things, including Charmap and FontManager (which is almost the same as FontViewer). Charmap is the worst, displaying basically every single font installed on the machine even if I select just the Bravura (why is that???!) -- FontManager does the same (???!) -- FontViewer is almost passable, in that (when the "Characters" tab is selected) it display empty squares for the characters not defined in Bravura. Therefore with lots of careful scrolling it displays the "actual things" I am looking for, but it does not show their unicode values, and it's an extenuating search of few actual characters in a huge ocean of empty squares. So it's a no go anyway.
Is it possible that the best solution is just to blindly type Unicode values as described in the docs and see what happens? I know, if I were running Windows or Mac I could use Dorico SE but more generally there must be a better way of using Unicode in Linux, perhaps built for other purposes?
If you’re looking for specific symbols in the SMuFL specification, the full list of glyphs is available on the SMuFL website. (Note that the fonts themselves know nothing about music typesetting, they are simply collections of shapes to be used by a typesetting program. Even the simple example you provided is a composite of several carefully scaled and positioned glyphs, and simply changing the character codes may or may not work as intended.)
If you’re looking for ways to input Unicode characters on Linux, see the many suggestions provided here: How to type special characters in Linux?

Installing Sublime Text 3 on Mac with ST 2 installed

Is it OK to install ST3 on Mac OSX 10.11.2 which has ST2 installed? and what things I need to look out for?
Thanks
I mean your only going to get benefits as you go up the chain so here are some(from hundreds):
Speed. Startup time, file load time, and Replace All have all been
significantly improved. If you're using OS X with a Retina display,
then you'll find huge rendering speed improvements too.
Symbol Indexing, for Goto Definition and Goto Symbol in Project.
Complementing these are the Jump Forward and Jump Back features.
Improved HTML Editing, including tag and attribute completion as well
as automatic tag closing.
Improved Project and Pane management, including multiple workspaces
for a single project.
Richer API. Plugins are better insulated from the application, and
now have a broader and fully threadsafe API to work with.
I have sublime text 3, and its the best code-editor ive used. Dont worry get sublime text 3 as it will only get better :)

Unicode in C using Eclipse IDE and Linux Redhat, relation between ttf, utf and charset

I am new to c , but i tried to compile unicode in c and worked with a sample program to
print kannada text, it is working fine . But in my project i need to use fribidi 0.19.6.
I do not have idea on character set and utf and ttf font. If I want to use kannada font in > linux what should i do . which ttf download package should i download for kannada fonts?
I have idea on character set and my doubt all about ttf and utf only
Thanks in advance
Manipulating unicode text, with modern opentype smart fonts, especially in the CJK domain like kannada, is a very complex problem. It involves many libraries, including fribidi (but not only).
http://behdad.org/text/
I strongly suggest using a high-level library like pango or harfbuzz-ng and not trying to reimplement support from the bottom up. Pango will manage fribidi and other parts of the fonts stack for you. Many very bright people have struggled for years to write those, and they're not perfect yet. There is no way you will do better alone in any reasonable amount of time especially when you don't even understand basic concepts.

How should I create a desktop mockup?

I want to create a desktop mockup on Elementary OS 0.2. By "mockup" I mean something that shows off the aesthetic of the mockup, mostly just showing what selecting/clicking/hovering over a button or widget does to that particular part of the UI. I'm thinking about creating the various parts on GIMP and coding animation and transition logic into the final result. I know that something like this can be done in HTML/JS, but I want to avoid using those. Is there anything optimized for a project like this? I'm open to most languages.
Try WireframeSketcher wireframing tool. Unlike Gimp or PowerPoint, WireframeSketcher is designed specifically to help you create mockups and wireframes. It comes pre-packaged for Debian systems and can also be found in Software Center and so it works on Elementary OS too. Note that it's a commercial tool, but you can try it freely for 14 days.
Most PMs at large companies mock these things up using a presentation package like PowerPoint. If you know the routine and where to click it can look fantastic with minimal effort.
MockupUI does both wireframe and Windows native looking mockups. It uses your desktop's visual style which makes screens and widgets look as a standard Windows application. MockupUI lets you export screens as individual images, docx, pdf or html.
Actions/interactions can be explained by highlighting widgets and adding text annotations.

Vim for Word (or something like it)

Are there any rich-text editors that have Vi(m) keybindings? Specifically, something like Word where I can compose a document with colors, headings, et al. but use Vi(m) bindings to move around and compose?
So if you have to use MS Word and want vim key bindings, there is an add on, but if you are not bound to that I would def. go for LaTeX + the vim latex suite.
Are you familiar with Latex?
Simply put it allows you to format your documents in plain text using tags or commands.
You then "compile" your document into the final format .pdf,.ps, etc.
Ex:
\documentclass{article}
\title{Cartesian closed categories and the price of eggs}
\author{Jane Doe}
\date{September 1994}
\begin{document}
\maketitle
Hello world!
\end{document}
This will allow you to write in vim, but still get professional non plain text output for your documents.
If you like Markdown or Latex, you could use the free open source Rstudio editor, with VIM-mode enabled. Export as either Word, PDF, or HTML etc.
Download Rstudio:
https://www.rstudio.com/products/RStudio/#Desktop
Read about markdown:
http://rmarkdown.rstudio.com/
If you wish to use vim for text editing, but want to, for example have text in different colors, bold it and such ... you can use Txtfmt plugin. It enables you, by using special characters, to "prettify" plain text files a little. They can look quite nice, and it comes handy if you're used to vim, and are, for example, writing documentation for your programs which you'll later just get in word, and make an adjustment or two, and ship off.
If you want to (or have to) stay with Word and don't want to shell out $100 for a ViEmu license, you can try using this AutoHotKey script for providing some basic vi-like functionality. The repo linked also provides a standalone exe to get the same without using AutoHotKey.
There are many good reasons to ditch word entirely, but sometimes that's just not an option :(
The Txtfmt plugin definitely provides the functionality you are looking for. It's a bit like having "rich text" capability for plain text in Vim.
Txtfmt (The Vim Highlighter)
Screenshots
The latest version supports 8 configurable foreground and background colors, as well as all combinations of bold, underline, italic, etc... The highlighting is token-based, but the tokens are rendered invisible by the syntax, and can be inserted with very convenient and intuitive mappings, which don't require you to remember anything: e.g., "bold-underline" could be specified with a string such as bu or ub. The version under development even supports visual maps, which will permit you to select some text and say (for example) "Make this text red, bold-italic", and have the plugin handle insertion/removal of the appropriate tokens automatically. (It's really quite simple and intuitive, however, even with the non-visual mappings.)
Although the plugin is highly configurable, the default settings are appropriate for most users, and the author is more than happy to answer any setup or usage questions...
There's a way of configuring Abiword to use vi key bindings
You can use the text editor of your choice with vim keys (vim, emacs, sublime, atom, vscode ,etc.) and write your document in markdown. Then use an open source tool called pandoc to translate it into almost any other markup language that you want. It is possible to compile your document to rich text formats including MS Word or even MS Powerpoint.
You can costumize your output by using a template.
Pandoc has extensive documentation and uses a richer markup syntax that allows you to do pretty much anything you want with the text. It is being actively developed by the community. Almost any major text editor has a few plugins for pandoc too.
You can use GlobalVim.
It can simulate vim modes and commands in most editing area.

Resources