Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Italic font reverts to a system font

Featured Replies

  • Newbies

I have labels (for books) that I print out, based on a text field which contains the book details. To properly do this, the name of the book needs to be italicised. But a very strange thing happens. Whatever font I put the field in, the italicised section just reverts to some kind of system font (I guess), doesnt matter what font I change it to. And it also changes the line spacing, for the italicised section. This occurs in preview, and when printing. I have no idea what is going on, or what to do about it. See attached:

Screenshot 2023-10-25 at 6.25.47 am.png

Screenshot 2023-10-25 at 6.25.55 am.png

1 hour ago, nowshiva said:

it also changes the line spacing

To me it looks more like the title also has its own font size, in addition to being italicized. And possibly its own font too, since you say it refuses to respect the font setting for the field. There could be two reasons for this: 

  1. Apparently this is a calculation field, so you could be overriding the layout settings in the calculation formula;
  2. The title could be stored as formatted text in its original field.

If you could post a small file that demonstrates the problem (and only the problem), it would be much easier to determine the exact cause and prescribe a cure.

 

  • Author
  • Newbies

Thanks for your reply. No, the font details are not programmed into the field itself. 

Here is the file. I just cant figure it out. You will see, its the labels layout. 

Steve

Learn Gestalt extra.fmp12

So eventually I discovered that the text in your example comes from the Text reference field. If you look at the result of GetAsCSS ( Texts::Text reference ) you will see:

<span style="" >Baum, J. (2022). </span><span style="font-family: 'Verdana';font-style:italic;" >Anxiously Attached : Becoming More Secure in Life and Love</span><span style="" >. Penguin Publishing Group.&#9;</span>

which shows that the title span is hard-wired to the Verdana font at the data level. You don't notice this when viewing the Central layout, because the field there is also formatted to display in Verdana. But on the other layout the default font for the field is Times, so the difference becomes apparent. 

I have added a cTest calculation field to your file that removes the font attribute, and used it in a copy of your label. You can observe the difference it makes in appearance. Eventually you should replace the contents of the original Text reference field with the results of this calculation (make sure you have a backup before you try that).

--
P.S. Next time, please remove everything in your file that's irrelevant to the problem.

 

Learn Gestalt extra 2.fmp12

I was curious how the problem might have been created and discovered something I didn't know (or perhaps did know at some point and forgot since?):

When you select some text in a field and format it as italic (or bold), the text is tagged not only with the selected style, but also with the font in which it is currently displayed. 

Further research shows that this was already reported as a bug -  but (typically) Claris maintain this behavior is a "feature" and do not intend to change it.


How to work around this bug:
Instead of selecting the text you want to style as italic and then choosing Format>Style>Italic from the menu, select the text and then run the following script step:

Insert Calculated Result [ TextStyleAdd ( Middle ( Get ( ActiveFieldContents ) ; Get ( ActiveSelectionStart ) ; Get ( ActiveSelectionSize ) ) ; Italic ) ]

 

This correctly adds only the font-style attribute to the selected text, without the unwanted font-family.

 

Edited by comment

  • Author
  • Newbies

Thanks so much. I really appreciate your help with this.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.