+ Reply to Thread
Results 1 to 3 of 3

Thread: How can I clear a custom font on an Text frame?

  1. #1
    Champion
    Join Date
    Jun 2011
    Posts
    561

    Default How can I clear a custom font on an Text frame?

    Does someone know how to reset a custom font applied to a text frame by :SetFont() ? Somehow I can't figure out how to reset it again.

    Cheers
    N.

  2. #2
    Plane Walker Kreiri's Avatar
    Join Date
    Feb 2011
    Posts
    402

    Default

    Well, I never used it, but there's Text:GetFont() in docs.

    Code:
    olSrc, olFont = texframe:GetFont() -- store old values
    textframe:SetFont(newSrc, newFont) -- set new font
    -- do something
    textFrame:SetFont(olSrc, olFont)   -- restore font
    Feminism is the radical notion that women are people.

  3. #3
    Champion
    Join Date
    Jun 2011
    Posts
    561

    Default

    Quote Originally Posted by Kreiri View Post
    Well, I never used it, but there's Text:GetFont() in docs.

    Code:
    olSrc, olFont = texframe:GetFont() -- store old values
    textframe:SetFont(newSrc, newFont) -- set new font
    -- do something
    textFrame:SetFont(olSrc, olFont)   -- restore font
    Awsome that hint was all I needed. Just did a small test addon creating a default font frame and retrieving the info which is set by the API as default.

    Thanks a lot for pushing me in the right direction.

    Cheers
    N.

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts