Newbies nowshiva Posted October 24, 2023 Newbies Posted October 24, 2023 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:
comment Posted October 25, 2023 Posted October 25, 2023 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: Apparently this is a calculation field, so you could be overriding the layout settings in the calculation formula; 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.
Newbies nowshiva Posted October 26, 2023 Author Newbies Posted October 26, 2023 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
comment Posted October 26, 2023 Posted October 26, 2023 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.	</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
comment Posted October 26, 2023 Posted October 26, 2023 (edited) 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 October 26, 2023 by comment
Newbies nowshiva Posted October 30, 2023 Author Newbies Posted October 30, 2023 Thanks so much. I really appreciate your help with this.
Recommended Posts
This topic is 380 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now