Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 7184 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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.

Posted

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?

Posted

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

Posted

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

Posted

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

Posted

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

This topic is 7184 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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