Formatting Text in Placeholders - officer

I'm using officer to create many ppt files. I have a template that i have been using for over a year that's worked great. Since the latest update (6.23.2019) the formatting of the placeholders in the slide master of the template do not persist to the output ppt. For example, in the slide master, I have a placeholder that is size 18, red, Adobe Clean Light font. When the ppt is rendered the text appears as size 24, black, Adobe Clean Bold font. Any ideas on why this is happening?

I don't have a great answer as to why this is happening, but the crux of the issue is using type/id instead of ph_label. If you use ph_label, the formatting persists from the template to the output ppt.

Related

LaTeX in R Notebook not rendering properly in HTML (hats are skewed to the right)

When I output an r Notebook to html, and use latex, most of the output renders fine.
When I use hats though, it's not lined up properly on the character I'm 'hatting'.
For example:
---
title: "R Notebook"
output: html_notebook
---
Hello Everyone, $\pi = 3.14159...$ but my estimate is $\hat{\pi}=3.13$
Outputs into an HTML file:
Even though, when I hover over the latex in the code, it renders properly:
Another thing I now notice is that, the latex output font when I hover is nicer than the HTML output, is it possible to change the HTML output font to the 'hovering' font?
EDIT: My OS and software versions are MacOS Catalina 10.15.3 with RStudio version 1.1.456
It turns out I just needed an RStudio update, and it solved the problem. I'd tried updating RStudio through the application, but since I had the option 'Ignore Updates' it would always notify me that I had the latest version, so I had to download the .dmg from the website and re-install.
If anyone can help me change the font though, I'd really appreciate it.

HTML browser not printing in new line

Need some help with browser printing.
I tried to create a form that have TextArea which insert \r\n into database (mongoDB) when type multiple lines of text just fine.
eg:
HP Color LaserJet Pro M252dw Toner (Y)\r\nP/N: CF402A
While in browser it goes to new line just fine (using white-space: pre) inline style
td(style="white-space: pre")=
eg:
HP Color LaserJet Pro M252dw Toner (Y)
P/N: CF402A
When printing from browser it's goes back into same row as before
eg:
HP Color LaserJet Pro M252dw Toner (Y) P/N: CF402A
I tried using pug .replace('\r\n','<p>') and it will show <p> as a string not as HTML syntax.
I'm using PUG as my template engine run on Node + Express
browser is Chrome.
I'm very new to programming so not sure if I'm doing it wrong or not?
Also this is first time I posting question in Stackoverflow so if I do anything wrong feel free to suggest.
Thank you very much for your answer :)
Found a fix from this link: https://github.com/pugjs/pug/issues/2583
it seems that I need to put ! in front of my variables

HTML Syntax Highlighting within Freemarker .FTL Spring STS

After a clean install of Spring Tool Suite and the necessary plugins my current project requires (of which Freemarker is one) I find that HTML seems to be ignored within all of my .FTLs and is just displayed as black text (see image of settings). Prior to this, any HTML tags, comments and strings were picked up and highlighted in the default colours given.
To clarify, now it's only the Freemarker specific syntax that is now detected.(Directives - Blue and Freemarker variables - Pink)
If anyone knows how to fix this issue I would be greatly appreciative!
Freemarker Preferences Image
That's https://issues.jboss.org/browse/JBIDE-22631. If you are using file .html.ftl or .xml.ftl (or ftlh or ftlx when JBIDE-22636 will be merged) file extension, it starts doing some highlighting, though it doesn't colorize the attributes differently anymore.

Text heavy iOS App. Store text in HTML, Plist, or Other?

I'm writing relatively complex iOS app that is very text heavy.
The text is also heavily formatted. It has lots of color, size, font, and spacing changes, as well bulleted lists and other text features you'd expect to see in a very rich website.
The text is displayed on about 40 different views. Some of which display a lot of text, others a little. There is no one template that all the pages follow. (There are some that are similar, but that's not the point.)
Lastly, the text is constantly being changed and updated by an editorial team during development, not so much after release. The text has to be stored on the device, downloading files is not an option.
My question is, what is the best way to store and then render all this text in an iOS App?
My approach
Store all the text content and formatting info in an html file and use
[[NSAttributedString alloc] initWithFileURL:htmlDoc
options:#{
NSDocumentTypeDocumentAttribute:NSHTMLTextDocumentType}
documentAttributes:&attrDict
error:&error];
to create a NSAttributed string and use that to populate UITextViews.*
*Note: I would do some more work before creating the UITextViews. First I would parse it to find the appropriate page number [[Page:1.3]] and then parse the elements in that section [[header]], [[side_scroller]], etc...
I like this approach for two main reasons:
It created a separate copy document that contained all the text
and formatting info.
I'm the only iOS developer, but we have a couple front-end
developers. So when we get slammed with changes that need to be done
in 3.45 minutes, I could have some of the guys help me make the
changes, without having to know all the nuances of UIFont and
related classes. Occasionally, the editors could even make the
changes themselves :)
Minor reasons for liking this approach:
The text can vary so much per page, that creating a new UIFont + Plist entry to store the formatting info seems like a bigger pain than having everything in a .html document. (I could be wrong about this.)
Project managers will inevitably say: "Make this word a little bigger," "This word looks strange, add italics," and "Make everything purple!" HTML/CSS seems like a more flexible solution for quickly implementing these requests.
Downsides of this approach:
NSAttributedString picks up 99% of the HTML attributes I threw at it. It did not pick bullet spacing changes in unordered lists <ul>.
Plists are more performant.
Here are some other approaches I considered:
Plist + UIFont
RTF Document - Originally started with this, but found it hid a lot of what was going on and NSAttributedString wouldn't pick up some of the changes.
XML
Any advice or input would very appreciated.
Notes:
iPad app,
iOS 7,
No Internet Connectivity,
Xcode 5
What I did to store styled text in an iOS app was to write a Mac OS command line tool that opens RTF files and converts them to attributed strings (It's a 1-line call in Mac OS, but not supported in iOS for some reason.) I then use NSCoding to save the attributed strings as binary data, with a special .DATA filetype.
I created a custom UITextView category with a method that knows how to load the text view's attributed text from my custom filetype.
I created a build rule in my project that treats RTF files as source files in a build step and the .DATA filetype as the output, and copies the .DATA files into the build project.
Now, all I have to do is add an RTF file to my project the build process inserts the .DATA version of the styled text into the executable.
The Xcode editor knows how to edit RTF files, so you can edit them right in place in the IDE, OR you can edit them in TextEdit or any editor that supports RTF files.
There are a few things you can put in an RTF that aren't supported in UITextViews. (I don't remember what those are offhand. Sorry.)
I find styled WYSIWYG text much easier to deal with than HTML. You just edit the text, and the build process picks up the changes.
It worked beautifully. Plus, binary NSCoding output is a whole lot more compact than HTML.
I would recommend using web view. It can open files in resource bundle.
You can disable all the links in HTML by implementing delegate method shouldStartLoadWithRequest to return NO.
You might also want to set dataDetectorTypes to UIDataDetectorTypeNone.
That will disable auto link detection in web view

How to convert MS Outlook smiley (Wingdings) to something displayable in a browser?

In the noble effort to re-invent every wheel, our company has recently rolled our own custom web-based e-mail app, of which I was the primary designer.
One thing I've noticed is that smileys coming in from MS Outlook-based e-mails (sent from third parties) are not appearing correctly. Example: A happy face just displays a J
The HTML of the inbound message comes in like this:
<span style="...;font-family:Wingdings;...">J</span>
I know that Firefox and Chrome do not support the Wingdings font because it is non-standard. However, I am tasked with coming up with a fix.
Is there a good way to either 1) force the browser to load and use Wingdings or 2) otherwise convert the J to a smiley?
I'd rather not do anything crazy like try some wingdings-detection-regex - or even worse, parse the DOM - just to get some stupid emoticons working. Maybe there is already some library out there that already handles this?
For what it's worth, GMail seems to not 'fix' this problem either. iOS doesn't in the message view, but puzzlingly does fix it in the inbox view (replaces the J w/ emoji)
EDIT
To clarify, this question is regarding inbound messages from third parties. Outlook, by default, autocorrects ":)" to the Wingdings smiley. There's nothing I can do to prevent this coming in. What I need is a solution to correct for this.
EDIT 2
Again, the app itself is a web based e-mail client (Gmail, etc.). E-mails go in to here, NOT to users' individual Outlook/phones/other e-mail clients. It only goes into the web app.
To avoid having to parse the HTML or manipulating the DOM, a simple solution would be to use CSS3 web fonts by linking the Wingdings font-family to a copy of the Wingdings font file on your server:
<style>
#font-face {
font-family: Wingdings;
src: url(link_to_wingdings_font_file.ttf);
}
</style>
However, a license is required for this approach.
You could embed the SWEC (Symbola-based Wingdings Emoticons Compatibility) font: https://drive.google.com/open?id=0BwDrnPQfa-aMOEx0bEZCQUNrSGs
It provides basic compatibility with Wingdings emoticons. (In Wingdings, "J" represents a smile, "K" represents a lack of expression, and "L" represents a frown.) Background: certain versions of Microsoft e-mail clients still in use change user-typed expressions such as ":)", ":|", and ":(" into "J", "K", and "L", respectively, and then specify Wingdings as the font family; recipients on systems which do not include a Wingdings-compatible font are not able to see the intended emoticons, which can cause confusion.
You need to manually substitute it prior to sending the email as you have no control over what fonts the reader has installed. You also can't include anything outside bland old html and css (unless you want to mess with VML)
First I would try running your wingding through a html converter to see if there is a html code for it.
Besides that, you could try a webfont wingdings equivalent, however there are issues with Outlook playing nice when webfonts are imported in email (ignores your font stack, falling back to Times New Roman).
Besides that, all that is left is ZephyrusDigital's suggestions of using an image or :).
Against my better judgement I have decided to go for the quick hack and just use a regular expression. Here it is for anyone else that runs into the same problem:
$html = preg_replace('/\<SPAN*?(Wingdings)*?[^\>]*\>J(\<o\:p\>\<\/o\:p\>)*\<\/SPAN\>/i', ' :) ', $html);
use :)
kidding!
why not save the wingdings smiley in photoshop as a png, or make another custom one? you could use <img src="http://something.com/images/smiley.png" style="display:inline-block;"/> and it won't look weird in a text block as long as it isn't taller than your line-height.