I'm was going reviewing a few autolisp and dcl tutorials (afralisp & autolisp-exchange) to brush up on the dcl code. To cut to the question, I see that the text can be underlined by the mnemonic in afralisp and the & in autolisp-exchange.
Is there a better way to underline a string of characters?
Can a string be made bold, italicized, or strike-though with this
file type?
If the above is true, is there a reference webpage that has a list of fonts that can be used with the dcl file type?
This webpage may contain the solution, but I haven't seen how: AutoDesk.com
In short, you cannot arbitrarily change the GUI font face or style using standard DCL.
The ability to underline text is purely an exploit of the mnemonic property which allows DCL controls to be manipulated using keys on the keyboard which correspond to the underlined letters as opposed to using the mouse to click such controls.
Whilst DCL text has the is_bold property, this has never worked (and likely never will). One alternative is to feign bold text using the set_tile function in conjunction with an image tile; or you can use the fixed_width_font property, but, as the name implies, this will change the text to use a fixed width font (the exact font cannot be changed).
One other possibility is to display text using the vector_image function applied to an image tile, as I demonstrate in the 'About' dialog for my Incremental Numbering Suite application.
Related
this is the first I'm working with PDFs on this level. So please be patient with
my noob question. I understand the logical and physical structure of an PDF file
on a basic level.
I have an PDF that contains a dummy ID that needs to be replaced. To check, if there
is way to do this, I used qpdf to expand the PDF using
qpdf --qdf --object-streams=disable orig.pdf expanded.pdf
Using a hex editor I located the dummy ID in expanded.pdf and changed the value by
simply swapping two digits
<001800180017> Tj => <001700170018> Tj
and saved it. Opening expanded.pdf in Acrobat didn't show the modification. The original
ID 443 is still rendered, but searching for "443" doesn't find it. When searching for
"334", the modified content, I get the rendered original ID 443 highlighted.
The PDF consist of text and vector graphic. When I insert additional digits (which obviously
invalidates the offsets in the xref), I get an error message regarding a missing font and
all digits are shown as dots but the vector graphic is still in place. This seems to indicate
that the ID is not part of the graphic.
What did I miss?
EDIT 1:
After mkl's comment, I did a deeper analysis of my PDF and found, that beside the obvious graphic content, all text was rendered by a series of m/l/c commands follwoed by a BT/ET section. Color for stroke and non-stroke was 0,0,0 for both in the BT/ET section.
Is this because of the used embedded non-standard font?
Are PDFs with embedded fonts usually done this way? A graphics part for the visual representation and a transparent (hidden) text part just to get searching and highlighting capabilities?
Looking back I wonder what I did to get the dots when I first modified the
content. I seems impossible and I can't reproduce it either.
Thanks
Tom
First off, the following is merely guesswork as you could not share the pdf in question. Educated guesswork but guesswork nonetheless.
You report that you changed the value by simply swapping two digits in the text drawing instruction argument and now can successfully search for the value with swapped digits but that Acrobat didn't show the modification.
Furthermore you observed that all text was rendered by a series of m/l/c commands followed by a BT/ET section.
The main situation in which one observes text being rendered as arbitrary vector graphics (a series of m/l/c commands), is in pdfs in which the producer didn't want text extraction to be possible and replaced text drawing instructions by arbitrary vector graphics instructions.
This apparently is not the case in your pdf as the text drawing instructions are not replaced but merely supplemented by the vector graphics ones.
Supposing that this construct is used for a reason and not by accident, I can only assume that the pdf producer was not willing or allowed to embed the font in question but wanted the specific font appearance to be displayed without having to count on the font being installed on the computer the pdf is viewed on.
Thus, the text appearance is drawn using arbitrary vector graphics instructions and the following text drawing instructions actually draw nothing but merely make the text searchable and extractable. This way there is no need to embed the apparent font face as font program. (Text drawing instructions can be made to draw nothing either by using a font with all blank glyphs or by using the text rendering mode "invisible".)
If this assumption turns out to be correct, your task to replace the dummy id requires not merely editing the arguments of the text drawing instructions but also replacing the arbitrary vector graphics instructions showing the dummy id appearance by other instructions showing the actual id.
If you happen to have the font in question and are willing and able to embed it, you can actually replace the arbitrary vector graphics instructions by text drawing instructions using the font. Otherwise be prepared to also draw the actual id as arbitrary vector graphics.
I've been searching for a while to know how Highlighting text (books on PDF, epub, mobi) works programmatically, what kind of code or tech stays behind this feature, yet I couldn't find anything. If you know, please share any hint here.
Thnx in advance
For PDFs you can highlight text by adding a highlight text markup annotation:
12.5.6.10 Text Markup Annotations
Text markup annotations shall appear as highlights, underlines, strikeouts (all PDF 1.3), or jagged (“squiggly”)
underlines (PDF 1.4) in the text of a document. When opened, they shall display a pop-up window containing
the text of the associated note. Table 179 shows the annotation dictionary entries specific to these types of
annotations.
(ISO 32000-1)
You can find details in Table 179. For a specification of annotations in general, read the earlier subsections of section 12.5 Annotations.
Alternatively you can also add the highlighting into the page content. This has the disadvantage that others cannot easily change the highlight (which actually might be an advantage in some use cases). Depending on the PDF viewers to support you might be forced to do this, though.
When working with guis of different kinds, I am used to the distinction of text field or text entry box versus text box. That is there is one type of object for the multi-line word processor style text box and another type of object for a single line, quite often non-scrollable text field / text entry box. Does wxTextCtrl serve both purposes? I know it does the text box but is it also the correct choice for the text field/text entry box?
EDIT
There are actually 2 types of text boxes for multi-line entry as pointed out in the answers. What really interests me are widgets specific for single line entry versus widgets specific for multi-line entry.
wxTextCtrl serves for both single and multiline entry. It is quite powerful but not exactly 'word processor style'. Closer to that would be wxRichTextCtrl.
wxComboBox uses wxTextEntry ( as does wxTextCtrl in single-line mode ). Although wxTextEntry is not offered as a control itself - it does not inherit from wxControl - if you like it so much you might be able to build something using it. But it seems like a lot of trouble for benefits that I do not see.
wxTextCtrl is a single line text control (what is called "entry" in other frameworks) by default. If you specify wxTE_MULTILINE style when creating it (this style can't be changed later), it becomes -- surprise -- a multi-line control, i.e. what is called "area" in other places.
I'm sure this is just a google search away, but I can't find the right search terms to find what I'm looking for.
I've created a DataPackage that has both HTML annd plain text content. I've used this in my copy and my sharing code and it works fine. I now want to create RTF output as some apps don't seem to accept HTML clipboard content.
I'm looking for a good guide to making RTF text that can be added to the DataPackage. I just need simple formatting including changing the font family, font size, font weight and adding newlines. The data comes from a list of objects taht I want to serialise as RTF, not from a text control on the screen.
WordPad outputs fairly clean RTF and some other text editors do as well. If that's not enough, you can download the RTF Specification 1.9.1 although like any specification that's probably overkill for what you're doing.
You can also use the SaveToStream method on the Document property of a RichEditBox from a Metro style app to share out as well.
I have tried a bunch of JSFL scripts to change textfields' fonts of a fla library. I used those scripts to change textfields' fonts for an embedded font which do exist in the library. All scripts run fine through Flash CS3 but always fail through Flash CS4
Let's give an example: replacing the "Arial" font used by all textfields in the fla scene by the "myEmbeddedArial*" embedded font (symbol).
The jsfl font replacement instruction is the following one:
textElement.setTextAttr("face", "myEmbeddedArial*");
I can give a lots of all details about this issue but does someone already observed it and may know about its root cause ?
Thanks
P.S: Note the Find/Replace "Font" feature of Flash CS4 IDE works properly only if the textfields contain not emtpy strings and only if the symbol including this textfield is in a scene and only if you search in "Current Document" (and not in "Current Scene").
I am not sure if it works for you but maybe:
http://blog.samueltoth.com/?p=142
Good luck,
Rob
I think I found a successful workaround. So the only way to properly do that in CS4 IDE is to use the find/replace function, but the textfields' content must not be empty.
Use your jsfl script to fulfill all empty textfields of your symbol library with a marker string like '####'.
Ensure all the embedded font symbols used on your textfields are in your fla library. Because find/replace tool will not parse the textfields which use some embedded font symbols which don't exist in the library. Indeed some embedded font symbols may have been deleted and/or mapped on a default font (manually or during a file conversion from CS3 to CS4). Especially take care to case sensitivity on the embedded font symbol names.
Create the missing embedded font symbols used on your textfields (with the right case sensitive names) before using find/replace feature.
Create the new embedded font symbols you want to use to replace the old embedded font symbols.
Now you should be able to use find/replace feature of CS4 properly even with embedded font symbols. Open find/replace window. Select "Search in: Current Document" (not in "Current Scene"). Create a new layer on your main scene. Create an instance of all the movie clips you have in your library in this layer (e.g: select all the symbol library then drag & drop the selection in the scene).
Don't forget to remove your '####' string marker from all the textfields by using your jsfl script or the find/replace Text feature of the IDE. Finally delete the layer you created for the font replacement operation and all the symbol instances in it.