Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 5 displays text file with a smaller/different font after my initial edit

I added an empty file called notes.txt to my project in Xcode 5. It is a list of comments that start with either an asterisk or hyphen, along with some blank lines. While editing it initially, the font size was fine. But after viewing some source files and coming back to notes.txt, the font was suddenly noticeably smaller.

I'm not seeing any font settings in the File Inspector in the Utilities view on the right side of the Xcode window. The file type is "Default - Plain Text". I tried changing this to "Objective-C Source" to see if that would have any effect, but it didn't.

The theme I'm using in Xcode's Fonts & Colors pref pane is Midnight, with Menlo Regular - 14.0 for the source editor, and Menlo Regular - 13.0 for the console (but I'm about to set that to 14.0 as well). However, the notes.txt file seems to be using a font of size 10 or 11. How can I fix this?

Edit: I just added a new line to the file, and I can see that the smaller text is in fact a different font. In the picture below, line 23 is old text and line 25 is new text. Line 25 looks like the Menlo font that I'd expect.

enter image description here

like image 410
bneely Avatar asked Sep 16 '13 09:09

bneely


People also ask

How do I change text style in SwiftUI?

Choose Show SwiftUI Inspector and then you can edit the text/font properties.

How do I change text size in Swift?

To change the font or the size of a UILabel in a Storyboard or . XIB file, open it in the interface builder. Select the label and then open up the Attribute Inspector (CMD + Option + 5). Select the button on the font box and then you can change your text size or font.


1 Answers

I think its a bug in Xcode 5.0

You can temporary fix it by right click on the text file -> open as -> preview, and then right click -> open as -> source code again.

like image 193
Kelvin Avatar answered Oct 14 '22 13:10

Kelvin