PDFlib- Right-to-Left textflow - right-to-left

I really need your help...
I use PDFlib-API and i want to write PDF right to left (like Hebrew, Arabic).
I found a way to do this, but it doesnt support text flow, it supports only in one line.
The code in this link:
http://www.pdflib.com/pdflib-cookbook/complex-scripts/starter-shaping/
I use class shaping (you can see it in the link), but the Parameter of textflow have to be false,
if i change it to true i get an error message:
PDFlib exception occurred:
[2582] fit_table: Bidirectional writing mode not supported in Textflow
How can I solve this?
or any idea how to write RTL with Textflow? (with PDFlib API)
Thanks!!

this is a documented limitation in PDFlib 9 and there is now workaround. As you can see from the error message, or also within the PDFlib 9 Tutorial, chapter 6.4.4 "Bidirectional Formatting":
Bidi processing is not currently supported for multi-line Textflows, but only for Textlines (i.e. single-line text output).

Related

Customize the Pandoc writer for the ConTeXt output format?

I'm currently trying to customize the standard writer built into Pandoc to produce output in the ConTeXt format from Markdown input. Unfortunately, the documentation to create a custom writer found at the Pandoc website is not giving me too much information apart from how to write a custom HTML writer. So, I would like to ask for help with some fundamental ideas:
What would be the preferrable way to add some (probably) very simple functionality to the ConTeXt writer, e.g.: I would like to rewrite the sequence of characters " - " (in a Markdown document) as another sequence "~-- " (in the resulting ConTeXt document).
If I understood correctly, I'm supposed to base my custom writer on the standard (built-in) writers... But where can I find these? There doesn't seem to be anything in /usr/share/pandoc/(I'm working on Linux).
The website mentions the "classic style" and the "new style". Apart from one obviously being newer, what style am I supposed to use?
I know that these questions may sound rather simple, but there doesn't seem to be a lot of information available beyond the usual basic stuff. Any help would be much appreciated.
Pandoc has another feature that is similar to custom writers, called "Lua filters". Filters are quite likely a simpler and better choice in this case: They allow to modify the internal document representation. E.g.:
function Inlines (inlines)
for i=#inlines, 3, -1 do -- iterate backwards through the list of inlines
if inlines[i-2].t == 'Space' and inline[i-1] == pandoc.Str '-' and
inlines[i].t == 'Space' then
-- Replace elements with raw ConTeXt
inlines[i-2] = pandoc.RawInline('context', '~--')
inlines:remove(i)
inlines:remove(i-1)
end
end
return inlines
end
The above would be used b writing it to a file, and then passing that file to pandoc via --lua-filters FILENAME.lua
The documentation for Lua filters is also less sparse and hopefully more approachable than the docs for custom writers.

How do you add custom syntax highlighting for an additional language to Light Table?

Do you need to write a plugin for this or can you do it e.g. with the user.behaviors file?
Where can I find a tutorial and comprehensive documentation on this?
LightTable uses CodeMirror for syntax highlighting.
If the language you want is one of CodeMirrors existing modes (and it's in the version of the node module that your version of LightTable is using) then you should be able to use the set-syntax command (ctrl+space then type "syntax" to find it) to apply it to the current editor. You can add the following to your user.behaviors file to associate the syntax with a given file extension:
[:files :lt.objs.files/file-types [{:exts [:eg],
:mime "text/x-example",
:name "Example",
:tags [:editor.example]}]]
If a CodeMirror mode is not available, you'll first need to write one. Here are some docs on Writing CodeMirror Modes.
#RobinGower's answer works for me, eg for Jade syntax highlighting add [:files :lt.objs.files/file-types [{:name "jade" :exts [:jade] :mime "text/x-jade" :tags [:editor.jade]}] ] to the user.behaviors file
#mydoghasworms - have you already seen these pages?
LightTable FAQ page
getting started
I found a few helpful things on both.

Structured debug log

I am writing a complex application (a compiler analysis). To debug it I need to examine the application's execution trace to determine how its values and data structures evolve during its execution. It is quite common for me to generate megabytes of text output for a single run and sifting my way through all that is very labor-intensive. To help me manage these logs I've written my own library that formats them in HTML and makes it easy to color text from different code regions and indent code in called functions. An example of the output is here.
My question is: is there any better solution than my own home-spun library? I need some way to emit debug logs that may include arbitrary text and images and visually structure them and if possible, index them so that I can easily find the region of the output I'm most interested. Is there anything like this out there?
Regardless you didn't mentioned a language applied, I'd like to propose apache Log4XXX family: http://logging.apache.org/
It offers customizable details level as well as tag-driven loggers. GUI tool (chainsaw) can be combined with "old good" GREP approach (so you see only what you're interested in at the moment).
Colorizing, search and filtering using an expression syntax is available in the latest developer snapshot of Chainsaw. The expression syntax also supports regular expressions (using the 'like' keyword).
Chainsaw can parse any regular text log file, not just log files generated by log4j.
The latest developer snapshot of Chainsaw is available here:
http://people.apache.org/~sdeboy
The File, load Chainsaw configuration menu item is where you define the 'format' and location of the log file you want to process, and the expression syntax can be found in the tutorial, available from the help menu.
Feel free to email the log4j users list if you have additional questions.
I created a framework that might help you, https://github.com/pablito900/VisualLogs

Define new mac text input source

I would like to create a new "International Text Input Source" along the lines of the built-in Japanese input source where you can type in roman letters and get a drop-down of choices to choose from. However, I have no idea where to start work on such a thing. Is it feasible, or would it be a complete hack?
All I've found so far is the Text Input Source Services which seems to be all about dealing with existing input sources.
Any pointers on where to begin would be highly appreciated, thanks.
Sounds like what you are really looking for is documentation the Input Method Kit (which was introduced with Leopard).
Here's Apple's release note and a reference guide.
The reason I thought of this answer was because I had worked with Apple's Number Input sample code a year or two ago.

Flex 4 Combo - using IME

I am trying to use ime (for hiragana input) in a flex 4 spark combo.
On creation complete I am setting the following.
cbx_text.textInput.imeMode = IMEConversionMode.JAPANESE_HIRAGANA;
And to check, tracing the following:
trace(cbx_text.textInput.enableIME); returns true;
trace(cbx_text.textInput.imeMode); returns JAPANESE_HIRAGANA;
However, when I select the text input and start to type some text I am unable to switch to hiragana.
I can set it to work on a textinput component with no problems.
<s:TextInput imeMode="JAPANESE_HIRAGANA"></s:TextInput>
Has anyone had any experience with this?
Any insights much appreciated.
Although I haven't had any experience with IME, I took a quick look at the documentation : http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/system/IME.html
Can it be that it's not enabled application wise? That, maybe what returns true is only valid for the component you are tracing from?
Obvious questions first:
Are you certain the TextInput is a member of cbx_text? I know this seems silly, but it's best to eliminate the obvious first.
Do you have an IME enabled on your computer? For example, do you regularly type in hiragana on your computer and have the appropriate language pack enabled?
Are you sending the IME the string appropriately? IME.setCompositionString() for windows computers?
Does your OS support the use of IMEs? Linux only supports the following methods:
Capabilities.hasIME
IME.enabled <= Can set or return value.
Try tracing hasIME and see if it's installed. Again, we're shotgunning here – trying to track down any possibility of a problem.
When all else fails, go to the source:
http://livedocs.adobe.com/flex/3/html/help.html?content=18_Client_System_Environment_6.html

Resources