Announcement

Collapse
No announcement yet.

Font Question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Font Question

    Hello,

    I wanna set the default font of my forum to Trebuchet MS,

    I tried Main Css and All style options options but it didnt worked. its just shows me this font in editor not in the posts.

    Please help me about it.

    regards.

  • #2
    One way would be to edit your postbit or postbit_legacy template.

    Find: $post[message]

    And enclose it in the following <div> tag:

    Code:
    <div style="font-family: 'trebuchet ms', sans-serif;">
    $post[message]
    </div>

    Comment


    • #3
      Thanks for the reply , there is no other way to do it via Style and templates section ?

      Comment


      • #4
        Not that I can see- the problem is, as I see it, is each DIV and table element has a unique name with the post id appended to it so settings 1 piece of extra css somewhere won't work.

        Maybe someone else has a better suggestion?

        Comment


        • #5
          thanks for the reply,

          You know I asked it because I have several custom products(like articles system and...) so I tried adding this plugin into the plugin system :

          Code:
          $post['message']="<font size='2' face='trebuchet ms'>".$post['message']."</font>";
          and it worked.

          Regards.

          Comment


          • #6
            That works too, however the only issue is that you're not supposed to use the <font> tag anymore, it's depreciated so there will come a day when newer web browsers might not recognize it. the appropriate way to do this now would be inline css styles using either <div> or <span> tags.

            Comment


            • #7
              Oh! I didnt know that ,thanks for the suggestion.

              regards.

              Comment


              • #8
                BirdOPrey5 Do you have any idea for using the <div> method in Plugin system ?

                Comment


                • #9
                  I suppose it could be done via a plugin via an "automatic template edit" - that is using a the function str_replace on the postbit template to find the opening <div> tag before the $post[message] and adding the font code to it- but I really couldn't imagine justifying going through all that trouble when a simple template edit will work. Plus if you have customized style the auto template edits may not work well.

                  Comment


                  • #10
                    Originally posted by PersianForums View Post
                    Hello,

                    I wanna set the default font of my forum to Trebuchet MS,

                    I tried Main Css and All style options options but it didnt worked. its just shows me this font in editor not in the posts.

                    Please help me about it.

                    regards.
                    I don't understand why you aren't seeing it. In just about every section of All Style Options is a place to add or edit your Font Family. You could leave all of them blank except the Body section. Make that one this:
                    Code:
                    'Trebuchet MS', sans-serif
                    As long as the visitor has Trebuchet MS on their computer system, then that's the font they will see everywhere on your forum. It's one of the most common fonts, but if you want to make sure they see an alternative of your choice, you can add other font family names after Trebuchet MS, separating each with a comma and a space.

                    Jim
                    If my post was helpful to you, please take the time to register at my forum and ask a question you've always wanted to know about floors.
                    www.TheFloorPro.com

                    Comment


                    • #11
                      Originally posted by eJM View Post
                      I don't understand why you aren't seeing it. In just about every section of All Style Options is a place to add or edit your Font Family. You could leave all of them blank except the Body section. Make that one this:
                      Code:
                      'Trebuchet MS', sans-serif
                      As long as the visitor has Trebuchet MS on their computer system, then that's the font they will see everywhere on your forum. It's one of the most common fonts, but if you want to make sure they see an alternative of your choice, you can add other font family names after Trebuchet MS, separating each with a comma and a space.

                      Jim
                      Thanks for the reply,
                      But I just wanna change only POSTs font not entire font of my forum , thats the point that I dont wanna use (and I cant use) the All style options Font feature to change my post font.

                      Regards.
                      Last edited by PersianForums; Fri 7th Jan '11, 4:58am.

                      Comment


                      • #12
                        Originally posted by BirdOPrey5 View Post
                        I suppose it could be done via a plugin via an "automatic template edit" - that is using a the function str_replace on the postbit template to find the opening <div> tag before the $post[message] and adding the font code to it- but I really couldn't imagine justifying going through all that trouble when a simple template edit will work. Plus if you have customized style the auto template edits may not work well.
                        Thanks for the reply,

                        So I used this code : (I used <span></span> instead of <div></div> because if I use Div there will be additional <break> in my posts. ) :

                        Code:
                        $post['message']="<span style='font-family:Trebuchet MS; font-size: 14px;'>".$post['message']."</span>";
                        is it ok ?

                        thanks for the help

                        Comment


                        • #13
                          This is where vB4 is an improvement as there's a specific stylevar to do this in vB4.

                          Apologies for the pointlessly annoying interjection.
                          MARK.B | vBULLETIN SUPPORT

                          TalkNewsUK - My vBulletin 5.5.6 Demo
                          AdminAmmo - My Cloud Demo

                          Comment


                          • #14
                            Originally posted by Mark.B View Post
                            This is where vB4 is an improvement as there's a specific stylevar to do this in vB4.

                            Apologies for the pointlessly annoying interjection.
                            Thanks for the reply,

                            Yes you are right, But In my own opinion vb3 is so much more stable than vb4 , all of my vb licenses are vb4 but I have not any vb4 installed forum.

                            Regards.

                            Comment


                            • #15
                              Originally posted by PersianForums View Post
                              Thanks for the reply,
                              But I just wanna change only POSTs font not entire font of my forum , thats the point that I dont wanna use (and I cant use) the All style options Font feature to change my forum font.

                              Regards.
                              Sorry, but that's not what you said in your original post. You said the default font for your forums.

                              If you want to, you can change the font for the class alt1. Although that background color apears on other areas besides the posts, it might be good to be consistent with the font family anywhere that background is used. The font size is different in posts than in, for instance, the thread lists or the forum lists, so it wouldn't be identical.

                              If you insist on changing the font family in only the message area of posts, this should do it:
                              Find in postbit_legacy template...
                              Code:
                              		<!-- message -->
                              		<div id="post_message_$post[postid]">
                              			$ad_location[ad_showthread_firstpost_start]
                              			$post[message]
                              		</div>
                              		<!-- / message -->
                              Change to...
                              Code:
                              		<!-- message -->
                              		<div id="post_message_$post[postid]" style="font-family:'Trebuchet MS', sans-serif;">
                              			$ad_location[ad_showthread_firstpost_start]
                              			$post[message]
                              		</div>
                              		<!-- / message -->
                              I assume the same code appears in the postbit template as well. So if that's the postbit you use, change it there instead of the postbit_legacy one.

                              Since you are asking about fonts and the CSS to change them, you might find this interesting reading: http://www.w3schools.com/css/css_font.asp

                              As an aside, it's always a good idea to post a link to the forum you are asking for help with.

                              R'gards,

                              Jim
                              If my post was helpful to you, please take the time to register at my forum and ask a question you've always wanted to know about floors.
                              www.TheFloorPro.com

                              Comment

                              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                              Working...
                              X