How can I change the fontSize in a textarea and a label plus the fontstyle->bold without using the GUIStyle cz it changes the fontcolor and the background color. I tried to use :
GUI.skin.label.fontSize = 20;
GUI.skin.textArea.fontSize = 20;
But that didn’t work so if anyone can help me I would be gratefull!!
By the way I am using javascript and not C#.
Have you selected a font? If you don’t the font size can act strangly.
How can I select a font? I am writing a script and I have written var Arial: Font; but that didn’t work how can I select a default font…?
ok never mind
I found out how to do it thank you 
When I am choosing a font I am getting the following errors:
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.ObjectSelector.ObjectsHaveThumbnails () (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/ObjectSelector.cs:240)
UnityEditor.ObjectSelector.CreateHierarchy () (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/ObjectSelector.cs:979)
UnityEditor.ObjectSelector.OnGUI () (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/ObjectSelector.cs:1050)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[ ] parameters)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/GUI/DockArea.cs:213)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/GUI/DockArea.cs:206)
UnityEditor.HostView.OnGUI () (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/GUI/DockArea.cs:107)
ArgumentException: Getting control 0’s position in a group with only 0 controls when doing Repaint
Aborting
UnityEngine.GUILayoutGroup.GetNext () (at C:/BuildAgent/work/6bc5f79e0a4296d6/Runtime/ExportGenerated/Editor/GUILayoutUtility.cs:392)
UnityEngine.GUILayoutUtility.BeginLayoutArea (UnityEngine.GUIStyle style, System.Type LayoutType) (at C:/BuildAgent/work/6bc5f79e0a4296d6/Runtime/ExportGenerated/Editor/GUILayoutUtility.cs:179)
UnityEngine.GUILayout.BeginArea (Rect screenRect, UnityEngine.GUIContent content, UnityEngine.GUIStyle style) (at C:/BuildAgent/work/6bc5f79e0a4296d6/Runtime/ExportGenerated/Editor/GUILayout.cs:211)
UnityEngine.GUILayout.BeginArea (Rect screenRect) (at C:/BuildAgent/work/6bc5f79e0a4296d6/Runtime/ExportGenerated/Editor/GUILayout.cs:201)
UnityEditor.ObjectSelector.SearchArea () (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/ObjectSelector.cs:312)
UnityEditor.ObjectSelector.OnGUI () (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/ObjectSelector.cs:1054)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[ ] parameters)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/GUI/DockArea.cs:213)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/GUI/DockArea.cs:206)
UnityEditor.HostView.OnGUI () (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/GUI/DockArea.cs:107)
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.ObjectSelector.OnDisable () (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/ObjectSelector.cs:138)
UnityEditor.ContainerWindow:InternalCloseWindow()
I don’t know what does it mean can anyone help me plz!!
There is lots of errors there. You need to go through them one by one. The first one usually happens when you try to access an object that has been assigned in the editor.
It is hard to say what all the errors are with seeing the code they are attached too.
yes when I wrote var myfont: Font; so in the inspector I got a variable that needs to be attached to a font so I chose a font and I selected the unicode character and I got those errors!!
Even when I select none i get those errors!!
Ok finally I solved that prblem I moved the font that I need to use to the Resources folder that exists in the Assets and I wrote :
GUI.skin.label.font=Resources.Load(“Adidas_Unity”);
GUI.skin.textArea.font=Resources.Load(“Adidas_Unity”);
with Adidas_Unity the name of the used font.
and it worked!!