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.

Featured Replies

Hello,

I think there has been a change in how GetAsCSS() works after the FMD 7.3 update. And that's my problem!

I have a field (F1) the content of which I intend to save as a HTML file. It contains formatted text (smallcaps, italics, etc.). I use a script and the function GetAsCSS(F1) and save it to a file with the extension HTML. Up to FMD 7.2 this worked perfectly. However, with update 7.3, if I use the same operation everything in the field that was Plain (font) becomes several pixels smaller than the other text. (My text does not contain any information concerning the size of the letters. They all are default.)

Here's my example:

the GetAsCSS() resulted till upd. 7.2 as follows:

<SPAN STYLE= "color: #000000;font-weight: normal;font-variant: small-caps;text-align: left;" >Wodecki, Bernard. </SPAN>

<SPAN STYLE= "color: #000000;font-weight: normal;font-style:normal;text-align: left;" >&quot;Jacob and Laban. The structure of judicial proceedings &quot;, </SPAN>

<SPAN STYLE= "color: #000000;font-weight: normal;font-style: italic;text-align: left;" >Vetus Testamentum </SPAN>

<SPAN STYLE= "color: #000000;font-weight: normal;font-style:normal;text-align: left;" >30 (1980) 192-207</SPAN>

After update 7.3 I get the following:

<SPAN STYLE= "font-variant: small-caps;" >Wodecki, Bernard. </SPAN>

<SPAN STYLE= "font-size: 12px;font-weight: normal;font-style:normal;text-decoration:none;font-variant: normal;letter-spacing: normal;text-transform: none;vertical-align: " >&quot;Jacob and Laban. The structure of judicial proceedings &quot;, </SPAN>

<SPAN STYLE= "font-style:italic;" >Vetus Testamentum </SPAN>

<SPAN STYLE= "font-size: 12px;font-weight: normal;font-style:normal;text-decoration:none;font-variant: normal;letter-spacing: normal;text-transform: none;vertical-align: " >30 (1980) 192-207</SPAN>

It is remarkable that the function automatically inserts font-size: 12px; as well as other extra information, but it does so only when the text is Plain.. Can anyone explain how this can happen? Or is this a bug in FMD 7.3?

Thank you.

I cannot reproduce your problem. This is what GetAsCSS() returns here:

<SPAN STYLE= "font-variant: small-caps;" >Author</SPAN>

<SPAN STYLE= "" ><BR>&ldquo;Title&rdquo;<BR></SPAN>

<SPAN STYLE= "font-style:italic;" >Subtitle<BR></SPAN>

<SPAN STYLE= "" >Ipsem dolorum...</SPAN>

Is your text pasted as styled text from another application?

I couldn't reproduce it either. Maybe someone with csbalogh [color:"blue"] Windows XP setup should verify too.

BTW, I'm using the Standard Edition.

HTH

Lee

  • Author

Ok.

I think I understand why you were not able to reproduce my problem.

If I use GetAsCSS in a field in which I simply type plain text alongside other formattings (smallcaps, italics etc.) my GetAsCSS works well.

But in my database GetAsCSS is based on a field that itself is dependent on the GetField function.

Please find a (fraction of) my database in the attachment:

the red [color:"red"] export records button takes you to a new layout. Then push red Export Records above and give a filename with a html extension (e.g. untitled.html). Open the file in a browser. The GetAsCSS field encoding you can see on the layout, too.

Note that the problem only appeared after the 7.3 update!

csb

OK, I think I see what's happenning here:

If you use the TextStyleAdd() function on a PORTION of a text, the 'plain' portions get tagged with an elaborate style sheet, including a 12px font-size attribute.

It looks like a bug. What's even stranger, the cure itself is a bug. The help file states, regarding the TextStyleRemove() function, that:

"The Plain styles cannot be used for this function."

However, if you do wrap the styled text with TextStyleRemove ( styledText ; Plain ), the plain portions will lose their express formatting tags and become style-less again. Curiously, TextStyleRemove ( styledText ; AllStyles ) doesn't do it.

I am attaching a demo that shows the problem and (hopefully) the fix.

CSSbugFix.fp7.zip

  • Author

After experiencing several hours yesterday, I also realised that the problem is caused by the "plain" font style. Though I couldn't have figured out the solution you proposed. Thank you.

csb

In a nutshell, the solution is this:

Instead of:

GetAsCSS ( yourtext )

use:

GetAsCSS ( TextStyleRemove ( yourtext ; Plain ) )

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.