Jump to content

Recommended Posts

Posted

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.

Posted

This post might help @Catshill

 

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  
B| (Please refrain from licking the screen while using this forum)

Affinity Help - Affinity Desktop Tutorials - Feedback - FAQ - most asked questions

Posted

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!

Posted

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.

Posted

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.

  • 1 month later...
Posted

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.

Posted

@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. :- )

 

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

Posted

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.

 

Posted

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.

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

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.