2014-02-25 4 views
1

나는 다음과 같은 코드가 있습니다, 난에 표시되는 모든 텍스트를 MS UI 고딕가 될 기본 글꼴을 설정하는신발 요소의 기본 글꼴을 설정 하시겠습니까?

Shoes.app title: "Add a person to database" do 
    stack do 

    title "Create a new person" 
    para "Enter their name:", :font => "MS UI Gothic" 
     @name = edit_line 
    para "Enter their age:", :font => "MS UI Gothic" 
     @age = edit_line 
    para "Enter their address:",:font => "MS UI Gothic" 
     @address = edit_line 
    para "Enter their mobile number:", :font => "MS UI Gothic" 
     @mob_number = edit_line 
    para "Enter their home number:", :font => "MS UI Gothic" 
     @home_number = edit_line 

    button "Add person to database" do 
     Person.new(@name, @age, @address, @mob_number, @home_number) 
     para newperson.details 
    end 
    end 
end 

대신의 각 요소에 대해 "MS UI 고딕"로 글꼴 스타일을 설정을 기원합니다 앱. 내가 찾은 튜토리얼에서이 작업을 수행하는 방법을 찾을 수 없습니다. 어떤 제안?

+0

설명서에있는 전역 스타일에서 아무 것도 찾을 수 없습니다. 이상한, 나는 그와 같은 것이있을 것으로 기대한다. 적어도 변수'para_style = {font : "MS UI Gothic"} "을 사용하여 각 파라에 전달할 수 있습니다. 최소한 스타일 정의를 중앙 집중화하고 단 한 곳에서 변경 작업을 수행 할 수 있습니다. 아직도 가난한 사람의 "해결책". –

답변

2

신발 3 또는 신발 4 중 어느 것을 사용하는지에 따라 다릅니다.

신발 3에서는 style Para, font: "MS UI Gothic"Shoes.app 블록에 넣을 수 있습니다. 그리고 그것은 앱의 모든 파라에 대한 스타일을 설정할 것입니다. Shoes4 새로운 루비에 앉아 있기 때문에

Shoes.app title: "Add a person to database" do 
    style Para, font: "MS UI Gothic" 
    stack do 

    title "Create a new person" 
    para "Enter their name:" 
    @name = edit_line 
    para "Enter their age:" 
    @age = edit_line 
    para "Enter their address:" 
    @address = edit_line 
    para "Enter their mobile number:" 
    @mob_number = edit_line 
    para "Enter their home number:" 
    @home_number = edit_line 

    button "Add person to database" do 
     Person.new(@name, @age, @address, @mob_number, @home_number) 
     para newperson.details 
    end 
    end 
end 

(1.9+) 대신 style Shoes::Para, font: "MS UI Gothic"를 작성해야합니다.

이 항목에 대한 Shoes3과 4의 차이점에 대한 자세한 내용은 github : https://github.com/shoes/shoes4/pull/460에서이 대화를 확인하십시오.

+1

그냥 신발 4에있는 글꼴 지원이 아직 거기까지는 아니지만 모두들. – PragTob

+0

저는 신발 3.2를 사용하고 있습니다.하지만'styles shoes :: Para, font : "MS UI Gothic"'내 글꼴을 설정해야했습니다. 내가 아치 리눅스 x86_64에있어. –

관련 문제