Difference between revisions of "Text Style Tips"

From FM Plugin Wikipedia
Jump to: navigation, search
m (Reverted edits by 200.1.123.30 (Talk); changed back to last version by Flisakow)
(Example CharacterStyle Functions)
Line 63: Line 63:
  
 
=Example CharacterStyle Functions=
 
=Example CharacterStyle Functions=
 +
 +
 +
This example shows how to change the style for a block of text.  In this case, we are changing the word 'text' to Bold, 12pt
 +
 +
fmx::TextAutoPrt myText;
 +
 +
myText->Assign("This is the text to change");
 +
 +
fmx::CharacterStyleAutoPtr myStyle;
 +
 +
myStyle->SetFace( fmx::CharacterStyle::kFace_Bold );
 +
 +
myStyle->SetSize( 12 );
 +
 +
myText->SetStyle( *myStyle , 12, 4 );
 +
 +
 +
 +
output will be  "This is the <b>text</b> to change"

Revision as of 00:19, 6 June 2008

This page is about editing and working with Text Styles passed from FileMaker to your plugin.

CharacterStyle::Color Public Functions

CharacterStyle Public Functions

  • void EnableFont ();
  • void EnableFace ( Face face );
  • void EnableSize ();
  • void EnableColor ();
  • void DisableFont ();
  • void DisableFace ( Face face );
  • void DisableAllFaces ();
  • void DisableSize ();
  • void DisableColor ();
  • void DisableAll ();
  • bool IsAllDisabled () const;
  • bool IsFontEnabled () const;
  • bool IsFaceEnabled ( Face face ) const;
  • bool IsAnyFaceEnabled () const;
  • bool IsSizeEnabled () const;
  • bool IsColorEnabled () const;
  • void SetFontInformation ( FontID font, Face face, FontSize size );
  • void GetFontInformation ( FontID &font, Face &face, FontSize &size );
  • void SetFont ( FontID font );
  • void SetFace ( Face face );
  • void SetSize ( FontSize size );
  • FontID GetFont () const;
  • Face GetFace () const;
  • FontSize GetSize () const;
  • void SetColor ( const Color &color );
  • const Color &GetColor () const;
  • CharacterStyle &operator = ( const CharacterStyle &rhs );
  • bool operator == ( const CharacterStyle &rhs ) const;
  • bool operator != ( const CharacterStyle &rhs ) const;
  • void operator delete ( void *obj );

Example CharacterStyle Functions

This example shows how to change the style for a block of text. In this case, we are changing the word 'text' to Bold, 12pt

fmx::TextAutoPrt myText;

myText->Assign("This is the text to change");

fmx::CharacterStyleAutoPtr myStyle;

myStyle->SetFace( fmx::CharacterStyle::kFace_Bold );

myStyle->SetSize( 12 );

myText->SetStyle( *myStyle , 12, 4 );


output will be "This is the text to change"