Karen_ Posted November 29, 2023 Posted November 29, 2023 Hi everyone, I'm interested in creating a text style where the first and last letter of a word has a stylistic set. However, I'm running into a problem where the letters in-between will also be given the stylistic set setting. How do I only have it applied to the first and last letter? Please see photos attached. Thank you! Quote
thomaso Posted November 29, 2023 Posted November 29, 2023 EDIT: sorry, doesn't work for all words of a paragraph. For the first character only it could be set in the paragraph style with a drop cap + the stylistic character style. For the last character I personally don't see a way in Affinity and assume the missing Grep Style feature would be required. – As workaround it might be possible to assign it after text creation via Find & Replace with a search via Regex for characters that are followed by a space character or punctuation mark and assign the style to the found letter only. Quote • MacBookPro Retina 15" | macOS 10.14.6 | Eizo 27" | Affinity V1 • iPad 10.Gen. | iOS 18.5. | Affinity V2.6
Karen_ Posted November 29, 2023 Author Posted November 29, 2023 @thomaso Thank you for your response. What do you mean by drop cap + the stylistic character style? Quote
thomaso Posted November 29, 2023 Posted November 29, 2023 7 minutes ago, Karen_ said: What do you mean by drop cap + the stylistic character style? I just noticed it wouldn't work (and edited my post). Drop caps is a paragraph style option and enables you to get a certain number of first letter(s) of a paragraph in a certain size and character style. So, currently I only see the workaround via F&R and Regex for both, the first and the last characters. Quote • MacBookPro Retina 15" | macOS 10.14.6 | Eizo 27" | Affinity V1 • iPad 10.Gen. | iOS 18.5. | Affinity V2.6
Karen_ Posted November 29, 2023 Author Posted November 29, 2023 @thomaso Would you be able to quickly explain how to F&R and Regex? It would be super helpful! Thank you Quote
thomaso Posted November 29, 2023 Posted November 29, 2023 45 minutes ago, Karen_ said: quickly explain how to F&R and Regex? Sorry, I can't do it quickly / I am not familiar enough with Regex. I just know for instance that, if you have Regex enabled in the F&R panel, the find/search expression [A-Z]\s would find all letters that are followed by a space. Via the cog icon next to "Replace with" you can choose a style to assign to the found results. Maybe someone more experienced will pop-in. Or you try to get more info in this site that also enables you to test in/output: https://regex101.com/ Or this tutorials/dictionaries for instance: https://www.regular-expressions.info/ https://regexone.com/lesson/introduction_abcs Karen_ 1 Quote • MacBookPro Retina 15" | macOS 10.14.6 | Eizo 27" | Affinity V1 • iPad 10.Gen. | iOS 18.5. | Affinity V2.6
Old Bruce Posted November 29, 2023 Posted November 29, 2023 Quickly? Not really. Regex is wildcards on springbreak. Here is one I use frequently \{(.+?)\} Honestly it is quite useful. I am looking for all the letters, numbers, and punctuation between curly braces. And I am storing the stuff between the braces but not the braces themselves. I can use what was found and replace it with \1 and assign a Character style to the string. Quote Mac Pro (Late 2013) Mac OS 12.7.6 Affinity Designer 2.6.0 | Affinity Photo 2.6.0 | Affinity Publisher 2.6.0 | Beta versions as they appear. I have never mastered color management, period, so I cannot help with that.
Karen_ Posted November 29, 2023 Author Posted November 29, 2023 @Old Bruce Oh gosh haha, that sounds extremely complicated as I'm not familiar with Regex and I can't seem to find the "find and replace" button in Affinity Designer. Thank you for explaining! Quote
thomaso Posted November 29, 2023 Posted November 29, 2023 1 minute ago, Karen_ said: the "find and replace" button in Affinity Designer It's a panel and available in Affinity Publisher only. Here's a 60 minute intro video of an APub user: Quote • MacBookPro Retina 15" | macOS 10.14.6 | Eizo 27" | Affinity V1 • iPad 10.Gen. | iOS 18.5. | Affinity V2.6
Karen_ Posted November 29, 2023 Author Posted November 29, 2023 @thomaso Thank you! I'll have a look as I can probably do it in Affinity publisher if the work around goes through Quote
Karen_ Posted November 29, 2023 Author Posted November 29, 2023 @thomaso @Old Bruce Thank you for your support/advice. I was able to learn enough Regex to make things slightly easier for me in Publisher! thomaso 1 Quote
MikeTO Posted November 29, 2023 Posted November 29, 2023 Does the font support contextual alternates? This is exactly the scenario that contextual alternates are designed to avoid. If the font supports this OpenType feature, you would be able to set it for the entire range of text and not have to worry about swash characters colliding in the middle of a word. Look for the Contextual Alternates option in the Typography window. Just because the option is present doesn't mean the characters you want are contextual but it's worth checking for. walt.farrell 1 Quote Download a free PDF manual for Affinity Publisher 2.6 Download a quick reference chart for Affinity's Special Characters Affinity 2.6 for macOS Sequoia 15.5, MacBook Pro (M4 Pro) and iPad Air (M2)
thomaso Posted November 29, 2023 Posted November 29, 2023 Here an example for F&R Regex to replace the last letters of words … i.e. every word character that is followed by any white space while letters followed by punctuation aren't included ([\w])(?=\s) … with a character style that has a stylistic alternative activated. – It appears useful to handle first vs. last characters differently, the "Replace with" format can only be one for all, so it seems to require separate styles for different variants if the font doesn't deliver glyphs for automatic change via "Contextual" options as 'Monkey' in this example: F&R last char stylistic.m4v For the first letter: (?<=\s)([\w]) Quote • MacBookPro Retina 15" | macOS 10.14.6 | Eizo 27" | Affinity V1 • iPad 10.Gen. | iOS 18.5. | Affinity V2.6
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.