태그:                         

Embarcadero RadStudio XE3 Trial을 설치했는데 기본 폰트가 “Tahoma”에 8포인트로 되어있어서 이걸 바꾸려고 그전에 Borland C++ Builder 6에서 했던 방법을 시도해봤다.

Borland C++ Builder 6에서 폼의 기본 폰트 바꾸기 참조.

그런데 RadStudio 2010 버전부터 좀 바뀐 것 같다.
아무리 해도 기본 폰트가 변경이 안된다.
구글링을 해봤더니 Delphi 2010: How to set Default Font for New Forms(원문 및 원문 링크는 아래에)라는 글이 나왔다.

적용하는 방법은 두 단계로 한다.

  1. HKEY_CURRENT_USER\Software\Codegear\BDS\10.0\Form Design의 Embedded Designer를 True에서 False로 변경한다.
  2. HKEY_CURRENT_USER\Software\Codegear\BDS\10.0에 새로운 키 만들기로 FromDesign(공백 없이)을 만들고, 그 안에 DefaultFont(공백 없이)라는 문자열 값을 만들어 값으로 폰트이름,크기(포인트)를 적는다(예, Arial,10)
  3. RadStudio를 다시 시작한다.

적용을 했더니…폼 디자이너가 독킹이 풀려서 에디터와 별도의 창으로 독립을 해버린다.
뭔가 이상하다.

좀 더 찾아봐야겠다.

원문 링크 : Delphi 2010: How to set Default Font for New Forms

I use Embarcadero Delphi 2010 (formerly Borland Delphi and/or CodeGear Delphi) for developing various Microsoft Windows®-based applications, and I generally love the IDE (Integrated Development Environment) for this RAD (Rapid Application Development) tool and object-oriented-development language and visual-component-library platform. But, once in a while I find some frustrations that just have to be dealt with the old-fashioned way: a registry-hack (or series of them)!

The latest need for a “fix” came when I moved from Delphi 2010 on Windows XP to using Delphi 2010 on Windows 7.  The old Delphi form-designer default form-font I was accustom too while under XP was Tahoma, which was just fine… but, according to Microsoft:

Users interact with text more than with any other element in Microsoft® Windows®. Segoe UI (pronounced “SEE-go”) is the Windows system font. The standard font size has been increased to 9 point.

So, I get Delphi 2010 installed on Windows 7 x64 (64-bit environment) and go about a quick test of creating a new VCL Forms Application ? and, for some reason I just rather expected the Default Font for Delphi 2010 to be Segoe UI 9-point… well, that is just not the case.  So, how could I make Segoe UI the default font for Delphi?  It should have been a simple single-entry into the registry (like it used to be in earlier Delphi versions), but no, that no longer works. Instead, the following sequence of registry changes must be implemented…

Registry Edits to Change Delphi 2010 Default Form Font

We start by navigating to the proper Windows Registry location (using REGEDIT). See the picture (click for larger version if needed)…

I began by adding a new key under HKEY_CURRENT_USER\Software\Codegear\BDS\7.0 called FormDesign (notice: no space in name); this is not to be confused with the existing key called “Form Design”.

Then, in the existing “Form Design” key (the one with a space in it), edit the value for “Embedded Designer” and set it to False. NOTE: the default font fix we are implementing here will not work unless you turn the embedded-designer off ? apparently this is thanks to a bug in Delphi 2010.

사용자 삽입 이미지
Form Design의 embedded Designer를 False로 바꾸자

Now, within that NEW FormDesign key (the one without a space!), add a key/value(string type) pair as show in the next image. This key has the name DefaultFont and an associated string value that contains your desired default font-name, font-size, and even style (e.g., you could append the word bold to this) ? in this example, I wanted Segoe UI 9-point (to fit with Microsoft’s Windows-7 standard font guidelines). Notice how if the font-name you choose to use has a *space* in it, you MUST enclose the font-name in double-quotes as shown or the Delphi UI will not implement your default font. There is no space anywhere else in the line I show (i.e., no space after separating comma, etc.)

사용자 삽입 이미지
FormDesign 밑에 DefaultFont 항목을 새로 만든다.

In the next image, I have shown a screen print of the Delphi 2010 Object Explorer showing the Font property values for a brand new form. you can see that my newly specified default Font-Name and Font-Size are taking effect in the Delphi 2010 IDE, albeit with the caveat that the form-designer is not currently “embedded” (since we had to turn off the embedded-designer to get this to work. You can toggle the embedded-designer back on (registry value = True) when you want to edit forms in the usual non-free-floating-form-editor layout. And, once you have your new form(s) created/saved, you can certainly set the embedded form designer to its default for good if you want (don’t worry — your new default font values are persisted when you save a form and will not change).

사용자 삽입 이미지
IDE에서 확인해보면 위에서 설정한 것으로 바뀌었다.

Updating Existing Forms to new Default Form Font

To quickly update any existing forms, and the controls / components contained on them, I simply did this:

  1. Created a new empty form (with my new Segoe UI 9-point, from new defaults)
  2. Opened up an existing form that needed its look updated; select-all; copy…
  3. Back on my new empty form, I pasted all the copied items.  Now, assuming you have a font-inheritance-hierarchy that supports what is going on (i.e., ParentFont property = True), your pasted controls should reflect that new look.
  4. Make adjustments for new visual size-differences, etc. in my layout.
  5. Close the old (original) form; name the new form to what the old was and save the new unit with the name of the old.  (note: I have everything under version-control; I suggest having this or some other means for rolling-back if you experience issues).

Enjoy!

관련글

Embarcadero RadStudio XE3에서 폼의 기본 폰트 바꾸기

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 항목은 *(으)로 표시합니다