Jump to content

Strange Text-Size bug


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

Recommended Posts

Hi all:

This is a weird one. I've got a layout where the user enters data for a quote, including the body of a short letter to go at the top of the quote. The client wants to be able to change the size of the text in the letter. Okay, no problem, right?

When the quote is printed out, it is printed from a related file (where all the line-items for the quote reside) and the letter body is a related field. Of course, it is formatted to a particular font & size (Courier 12). I've got a script which copies the text in the quote db, then pastes it into the field (really the same field) in the printout layout in the related file. Here's where it gets wierd.

If the new text is, say Courier 9, the whole thing works fine. The printout is in Courier 9. If, however, it is Courier 10 or Courier 11, for some reason it snaps back to Courier 12 when you get back to the original quote db. In other words, the formatting is lost. Why?

This one's killing me, and it is Saturday night, and I'm still at my desk. Time to go out and have a beer, and hope that the FM Forums gods smile on me by Monday morning.

-Stanley

Link to comment
Share on other sites

Hello Stanley,

There's no great mystery here. Rather than being a bug, what you are describing is a part of the consistent way in which current versions of FileMaker handle different levels of formatting.

There are two separate 'tiers' at which text attributes can be applied; the default for each copy of a field, and the custom character level formatting applied directly to the contents of a field. The latter overrides the former and is applied directly to the stored data (thus it appears wherever the data is seen, regardless of the formats applied to the field box it is appearing in).

When you paste formatted text into a field, the default text formats for the particular field box you are pasting in through are used as the reference point to determine which (if any) custom formatting attributes need to be retained and stored with the text in order for it to display in that field box with the custom formats that it carries with it (on the clipboard). Formats that are inconsistent with the layout/fieldbox defaults are stored in order to preserve the appearance of the pasted text, whereas formats which are already the same as those specified for the text box you are pasting into are discarded.

Moreover, if you paste text that does not carry specific formatting data into a field immediately following (or replacing) text which does carry explicit (custom) formatting, the custom formatting will be applied to the pasted text. This principle applies separately to each format type attribute (bolding, italicization, font face, size etc).

Thus, the act of pasting text into field boxes with different default formats applied can be used to selectively strip text formatting attributes - and pasting text into fields within which custom formats (which differ from the relevant field window's defaults) are already present can be used to apply formatting.

It's this precise application behavior that has been used in various high end solutions in current and previous versions of FileMaker to control the automatic application and selective removal of custom text formats. If you're interested, you'll find a simple example of the ways this kind of process can be applied in the demo file at:

Formatting All Occurrences of a User-Specified Word/Phrase in a Field

From what you're saying, I believe you've simply come up against a naturally occurring consequence of the way in which the two 'tiers' of text attributes are handled and the ways they interact. Perhaps with the above explanation you will be better placed to structure your scripting around principles which will deliver the intended outcomes. wink.gif

Link to comment
Share on other sites

Ray:

So, if I get you right, the reason I'm seeing what I'm seeing is that in one layout I've got the default set to Courier 10, and in another I've got the default set to Courier 12. If I copy Courier 10 text from the one that's default is 12, and paste it into the one that's set to 10, the formatting disappears, because I am pasting in something identical to the default. Thus, when I go back to the original layout (Courier 12) it appears as 12 rather than 10. So, if I make the default something unusual like Courier 13 where I'm pasting, then all formatting should stay. I'll give it a shot.

Thanks

-Stanley

Link to comment
Share on other sites

Ray:

That works. I've changed the other layout to Courier 13, and now all formatting stays; I don't even need to copy and paste to preserve the formatting. Excellent. Thanks again for the excellent overview.

-Stanley

Link to comment
Share on other sites

This topic is 7355 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.