how to put text at random position in xaringan - r-markdown

I'm trying to put some text in the slides at certain position on top of other stuffs/plots, is that possible? Here is one scenario, the slide is occupied by pictures and texts, but I like to give one sentence conclusion by a different color on top of them, the text just like a stamp to the slide, it's better if I also can adjust the text orientation, just like in powerpoint or keynote, you can add text at any position and style.

Related

how to create an outline of a text with fonts with separate polygons for each letter?

I want the outline of text with the standard Windows font "Bahnschrift". I tried to convert it with "Path->Object to Path" and then setting fill to X and stroke to black, but looks like the font is constructed with separate polygons for each letter. See this example:
Top is Bahnschrift, and bottom is Arial which works fine.
Is it possible to calculate somehow automatically the outline of the top text, without intersections, and without doing it all manually for all the letters? And including the right outline for letters with holes, like the "e"?
Some letters are even kind of twisted internally, looks pretty bad:
So I guess an algorithm to detect if it is a real hole, or if it is a hole from such twists and to ignore it, could be difficult.
Select the complete character in question. Then select from the drop down menu:
Path intersection followed by path union. This fixes the character font outline problem where the outline crosses into the body of the character.

wxpython :How I can get the word position in wxrichtextctrl when the window is resized?

My program reads docx file using python-docs tools then display the text on wxrichtextctrl. I stored the screen position of each word ,when it is written on the richttextbox. The problem is when the window is re-sized by the user the words positions are changed how I can catch this change. Because I want to highlight and draw dashed underline for specific words.
Any idea.
Thanks in advance.

Show data with Rapheal on click

I am hoping to use Raphael to draw a map and colour code according to a result for an area. That bit I can do. What I would like to do is if the user clicks an area that somewhere additional data appears. Is this possible. Within each element in the Raphael JS file, can I include a data source?

Vertical centering of multi-line cstatic text in MFC

How can one make a CStatic with text auto-wrap (multiline) which vertically centeres the result in the control's rectangle?
The problem I'm trying to solve is this: I have a CStatic control next to a CComboBox which updates information text depending on the choice. This text can be either short or long, requiring the CStatic to sometimes use multi-lines, and sometimes not. I want the info-text be vertically center-aligned with the CComboBox.
Now here is the problem:
If I make the CStatic only 1 textline high, it looks good for 1-line texts, but multi-lines do not fit and are not displayed.
If I make the CStatic higher to fit 2 lines, it looks good for long texts (with 2 lines), but 1-line-texts are shifted upwards, as the CStatic aligns the text on the top. A CStatic with the behavior mentioned in the question would solve this...
If I can't easily get a vertically centered CStatic multi-line control, the alternative would be to resize the control rect depending on the amount of text in it. But in this case I have a different problem:
How can I programatically find out how many lines a text will need in a CStatic of specific width?
Unfortunately you can't vcenter multi-line text in a CStatic.
Your next question has a solution but it's a bit of a pain to use. What you do is you use CDC::DrawTextEx with the DT_CALCRECT flag to get the size (in pixels) of the text you want to format. By dividing that by the height of a line of text (given in the font info you can get from the DC, plus some spacing which I'm not sure of how much that is - presumably it's a fixed amount, I don't think you can specify line spacing with DrawText), you will get (an approximation of) the number of lines you will get. You can then resize the control rect.
Come to think of it, you are probably better off not converting to lines and just resize your control to the extent you get from DrawTextEx :)
Things like this usually require some experimentation to get exactly right, and sometimes behave differently between OS versions. Proceed with caution.

Wrap text around the image

Can a list of Label objects and picture be aligned such a way that if the label has space in the right side it should make use of the full length before wrapping to the next line.
This is because of that fact that I may not have pictures of full height of the pane always.
For shorter images I want to make use of the space at the bottom.Note that the text is a nodelist of label nodes.