Menu

Default Comment Formatting

2007-04-16
2012-11-13
  • banzaimonkey

    banzaimonkey - 2007-04-16

    The default comments in Comic Sans size 8 are terribly difficult to read.  I download a lot of open source scripts and source files and it's very important to be able to read the comments.  I find it extremely taxing trying to read the comments when they're *so small*.  I've changed my styles to show comments in the default text size, in Courier New.  I wanted to suggest that this be made the default to improve readability and save everyone's eyesight.

     
    • Nobody/Anonymous

      As posted before, could this edited stylers.xml file be offered as a separate download?

       
    • Nobody/Anonymous

      I totally agree!

       
    • M. B. Huffman

      M. B. Huffman - 2007-04-16

      I also agree.
      A reasonably quick fix is the following Find/Replace operation on the file stylers.xml in the main Notepad++ directory (with the Regular expression box checked):

             Find what:  Comic Sans MS(.+fontSize=")8
          Replace with:  \1

      It changes everything that that was Comic Sans MS font size 8 to the default.

      Mike

       
      • Nobody/Anonymous

        Here is a little demonstration of where the Comic Sans MS font is used in the stylers.xml file and how to change them _all_ to the default font and size, set in the Global Style.

        Open Notepad++. Close all files. Choose to open a file, navigate to the stylers.xml file. Do not open it directly, but make a copy first in the file open dialog by dragging and holding down the CTRL button, then releasing the mouse button. Open this copy of stylers.xml to work on.

        First we want to find all uses of the Comic Sans MS font.

        Type CTRL+F to open the Find dialog. Type Comic Sans MS in the "Find what" combobox. Now we use the very handy feature "Find all in all opened documents". Enlarge the Find dialog to see more of the find results. With the default stylers.xml file you'll have 105 hits, _most_, not _all_, of them are COMMENT or related word style appearances.

        We want to remove most COMMENT wordstyle font settings first. Most of them are the same. Now copy from one of them the last part of the line starting from fontName=.
        Copy this selection from the dialog or the next line:
        fontName="Comic Sans MS" fontStyle="0" fontSize="8" />

        Now paste this selection in the "Find what" combobox.
        Click "Find all in all opened documents" again.
        This should result in 91 results with the default stylers.xml file.
        As you can see when scrolling through the list, these are all COMMENT wordstyles.

        It is safe to replace these all by the default font style and size.
        Now use the very handy "Switch dialog" button.
        Paste the selection also in the "Replace with" combobox.
        Now change the fontName= value into "" and do also with the fontSize= value.
        Click "Replace all".

        Click "Switch dialog" again.
        We will now look at the other Comic Sans MS uses left in the stylers.xml file.
        From the "Find what" combobox dropdown list, select Comic Sans MS again.
        Click "Find all in all opened documents" again.
        There are still 14 matches, 9 of which are also COMMENT wordstyles.
        Most of them have the following fontstyle settings:
        fontName="Comic Sans MS" fontStyle="1" fontSize="8" />
        Copy this part of the line or simply copy this line above.

        Replace these all by the default font style and size is done as previously:
        Use the "Switch dialog" button again.
        Paste the selection in both the "Find what" and the "Replace with" comboboxes.
        This is necessary to keep the fontStyle="1" setting.
        Now change the fontName= value into "" and do also with the fontSize= value.
        The "Replace with" combobox should now contain the following text:
        fontName="" fontStyle="1" fontSize="" />
        (You could of course also copy and paste this line above.)
        Click "Replace all", 8 tokens will be replaced.

        Now there are still some appearances of Comic Sans MS.
        Click "Switch dialog" again.
        From the "Find what" combobox dropdown list, select Comic Sans MS again.
        Click "Find all in all opened documents" again.
        These 6 wordstyles, including one more COMMENT wordstyle.

        Because the fontSize has no setting for these, we can simply replace the Comic Sans MS fontname by an empty string.
        Use the "Switch dialog" button again.
        Clear the "Replace with" combobox.
        Click "Replace all". The last 6 tokens will be replaced.

        You can simply check the absence of the Comic Sans MS font now by switching the dialog a last time and finding all appearances in all documents again. There should be 0 hits left now.

        If you want these to be the default settings, swap this edited file with the original stylers.xml file.

        It may seem a lot of work, but it demonstrates in a simple way all the Comic Sans MS fonts one might forget or oversee by using the regular expression mentioned earlier.