Catshill Posted February 16, 2020 Posted February 16, 2020 Is it possible to import text into a Publisher text frame, set a text style and retain bold and italic styles? I copy and paste text from Google docs or MS Word into a text frame and use a default publisher base style to set. The only attributes I need are bold and italics but the Paragraph base style changes these to non bold and non italics. I am looking for a merge styles option . I want to keep the base paragraph style in Publisher in order to retain consistency across many imported text files. Quote
firstdefence Posted February 16, 2020 Posted February 16, 2020 This post might help @Catshill Quote iMac 27" 2019 Sequoia 15.0 (24A335), iMac 27" Affinity Designer, Photo & Publisher V1 & V2, Adobe, Inkscape, Vectorstyler, Blender, C4D, Sketchup + more... XP-Pen Artist-22E, - iPad Pro 12.9 (Please refrain from licking the screen while using this forum) Affinity Help - Affinity Desktop Tutorials - Feedback - FAQ - most asked questions
Dan C Posted February 16, 2020 Posted February 16, 2020 Hi Catshill Unfortunately we don't currently support Style Merging, although this has been requested previously here - Currently when changing the text style of imported text you'll have to manually re-bold/italicise your text, my apologies! Quote
Catshill Posted February 16, 2020 Author Posted February 16, 2020 Thanks @andy5812 for replying. I did read that thread but it wasn't a solution as it wasn't a case of missing fonts. Thanks too to @Dan C confirming that it is not possible to merge styles. After experimenting I think I have sort of found a workaround... From Google Docs choose Download RTF - Open file in MS Word and copy text containing bold and italic formatting. In APub use Edit > Paste - Text retains bold and italics but also creates a new style based on the Word style formatting From Text Styles tab select hamburger icon to the right of the required style (body text in my case). Choose "Apply body text to paragraphs and preserve character formatting"* - This is the key bit for my issue Caveat - This method will retain the font size (as well as spelling language and character fill) from the original so either change it in Word before copy or do it in APub once pasted. I also deleted the text style(s) carried across from Word. A sanity check for the above would be appreciated. Quote
Wosven Posted February 16, 2020 Posted February 16, 2020 1. If you want to keep those character styles, first create 3 character styles: bold_italic bold italic 2. Import your text, and use search & replace to apply the character styles. 3. Next, you can apply you paragraph styles, the character styles will stay. Fun Art Sam and Catshill 2 Quote
Dan C Posted February 18, 2020 Posted February 18, 2020 On 2/16/2020 at 4:07 PM, Catshill said: A sanity check for the above would be appreciated. I can confirm this method seems to work for all formatting tested - thanks for the workaround Catshill 1 Quote
BryceB Posted March 19, 2020 Posted March 19, 2020 Thanks Wosven! I tried your workaround and it worked for me. To remind myself how it works (and for those who aren't find & replace experts) I posted a screen capture to YouTube showing how I follow your steps. The search and replace with regular expressions is a little tricky if you've never done that kind of thing before. Preserving bold and italic text when importing to Affinity Publisher. Fun Art Sam, Wosven and MikeA 3 Quote
MikeA Posted March 20, 2020 Posted March 20, 2020 @BryceB Thanks for making that video. One thing I noticed in the discussion about regular expressions: unless Affinity Publisher's implementation of regexes is different from what I used in Perl, then: .* means not "one or more of any character" but "zero or more of any character." If you want "one or more," use: .+ If Affinity Publisher supports this, there's also: .? ... to mean "zero or one of the preceding character or expression (in this case: "any character"). Now of course I'm going to have to find out if it also supports greedy vs. non-greedy matches. How time will fly... It was interesting to see that you were able to use "$1" for the "captured" buffer. A comment I saw here a couple of days ago used "\1" instead. So then I thought: Affinity Publisher must require "\1" rather than "$1". Clearly it doesn't. In Perl, "\1" can be used in the replacement string but is more likely to be used within the search string — to refer to something captured to a buffer via parentheses — within the same search string. I was surprised you were able to use "Apply 'Body' to Paragraphs". I would have thought the command should be "Apply 'Body' to paragraphs and preserve character formatting" (or "...and preserve local formatting"). After reading that Publisher doesn't yet support style merging, I'm tempted to go about it this way: 1. Style everything precisely as needed in the word-processing program (I use the Softmaker Office editor called TextMaker, which writes .docx format). 2. Import the word-processor file — Publisher will create new styles named to match those of the incoming document. 3. Tell Publisher just to delete all unused styles in the document. Wonder if it'd work. :- ) BryceB 1 Quote Affinity Publisher and Photo 1.8.3 (Windows). Lenovo laptop with decidedly sub-optimal monitor. At least it works.“The wonderful thing about standards is that you can have as many of ’em as you want.”– Anonymous cynic
BryceB Posted March 20, 2020 Posted March 20, 2020 Thanks for the feedback! Yes, you're right about ".*". Either that or ".+" will probably work in a practical sense to find the text. I didn't even look to see if Affinity has info on regular expressions in their help docs. I don't use them enough to keep it all memorized, so I just tried a couple of things from memory until it worked. Quote
MikeA Posted March 20, 2020 Posted March 20, 2020 I found only a little bit of information about regular expressions in the online help. It appears that Publisher supports Perl-style REs. They don't cover the topic extensively (of course that'd be an entire book unto itself. You're right: both ".*" and ".+" would work for what you're doing in the video. Quote Affinity Publisher and Photo 1.8.3 (Windows). Lenovo laptop with decidedly sub-optimal monitor. At least it works.“The wonderful thing about standards is that you can have as many of ’em as you want.”– Anonymous cynic
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.