2014-02-06 2 views
0

다음 URL에서 wkhtmltopdf는 ttf 형식 글꼴 만 사용하는 것으로 알려져 있습니다. use custom fonts with wkhtmltopdf Google Web Fonts and PDF generation from HTML with wkhtmltopdfwkhtmltopdf를 사용하여 동일한 글꼴 모음 이름을 사용하지 않는 글꼴

내 웹 사이트는 그것 때문에 내가 TTF 폰트를 추가 할 사용자 스타일 시트를 사용하고 있으므로, 단지 WOFF를 사용합니다. Oxygen, Inconsolata, Open Sans, merriweather와 같은 많은 Google 글꼴을 사용하고 있습니다. user-style-sheet에서 같은 글꼴 이름을 사용하고 올바르게 렌더링하면됩니다. 그러나 문제는 'Open Sans Condensed Open'글꼴과 'goudy'글꼴 정렬입니다. 글꼴 - 패밀리 이름을 다른 것으로 변경하려고 할 때, 정확하게 동일한 이름으로 렌더링되지 않습니다. 로컬 글꼴이 아닌 웹 글꼴을 사용하기 때문에 동일한 이름을 사용하고 변수 이름을 변경하고 싶지 않습니다. 둘째로, 내 시스템에 글꼴을 다운로드하고 사용하지 않고 웹 글꼴 만 사용하고 싶습니다. 내가 userstylesheet을 사용하고있는 방법이

@font-face { 
font-family: 'Inconsolata'; 
font-style: normal; 
font-weight: 400; 
src: url('https://googlefontdirectory.googlecode.com/hg-history/829b7e77062a1a06dfc90c29f0f413e2a1de44fe/inconsolata/Inconsolata.ttf') format('truetype'); 

} 

@font-face { 
font-family: "sorts mill goudy"; 
font-style: normal; 
font-weight: 400; 
src: url('https://googlefontdirectory.googlecode.com/hg-history/73427626e72275f857e7fdfd29e0a5c52516fed5/sortsmillgoudy/SortsMillGoudy-Regular.ttf')  format('truetype'); 
/* 
src: url('https://bienvenidod-fonts.googlecode.com/hg-history/73427626e72275f857e7fdfd29e0a5c52516fed5/sortsmillgoudy/SortsMillGoudy-Regular.ttf')  format('truetype');*/ 
} 

@font-face { 
font-family: 'Sorts Mill Goudy'; 
font-style: italic; 
font-weight: 400; 
src: url('https://googlefontdirectory.googlecode.com/hg-history/73427626e72275f857e7fdfd29e0a5c52516fed5/sortsmillgoudy/SortsMillGoudy-Italic.ttf') format('truetype'); 
} 

@font-face { 
font-family: 'Merriweather'; 
font-style: normal; 
font-weight: 300; 
src: url('https://jenniferespencer-webfont.googlecode.com/hg-history/0ab6594f99d5904bb834e02e43d1d536c87f8622/merriweather/Merriweather-Light.ttf') format('truetype'); 
} 
@font-face { 
font-family: 'Merriweather'; 
font-style: normal; 
font-weight: 400; 
src: url('https://jenniferespencer-webfont.googlecode.com/hg-history/0ab6594f99d5904bb834e02e43d1d536c87f8622/merriweather/Merriweather-Regular.ttf') format('truetype'); 
} 
@font-face { 
font-family: 'Merriweather'; 
font-style: normal; 
font-weight: 700; 
src: url('https://jenniferespencer-webfont.googlecode.com/hg-history/0ab6594f99d5904bb834e02e43d1d536c87f8622/merriweather/Merriweather-Bold.ttf') format('truetype'); 
} 

@font-face { 
font-family: 'Open Sans Condensed'; 
font-style: normal; 
font-weight: 400; 
src: url('http://testinghtmltopdf.site40.net/fonts/OpenSans-CondLight.ttf') format('truetype'); 
} 


@font-face { 
font-family: 'Open Sans Condensed'; 
font-style: normal; 
font-weight: bold; 
src: url('http://testinghtmltopdf.site40.net/fonts/OpenSans-CondBold.ttf') format('truetype'); 
} 

@font-face { 
font-family: 'Open Sans Condensed'; 
font-style: italic; 
font-weight: 300; 
src: url('http://testinghtmltopdf.site40.net/fonts/OpenSans-CondLightItalic.ttf') format('truetype'); 
} 
@font-face { 
font-family: "open sans"; 
font-weight: 400; 
font-style: normal; 
    src:url('http://themes.googleusercontent.com/static/fonts/opensans/v7/cJZKeOuBrn4kERxqtaUH3aCWcynf_cDxXwCLxiixG1c.ttf') format('truetype'); 
} 


@font-face { 
font-family: "open sans"; 
font-weight: 700; 
font-style: normal; 
src:  url('http://themes.googleusercontent.com/static/fonts/opensans/v7/k3k702ZOKiLJc3WVjuplzInF5uFdDttMLvmWuJdhhgs.ttf') format('truetype'); 
} 

@font-face { 
font-family: "open sans"; 
font-weight: 700; 
font-style: italic; 
src:  url('http://themes.googleusercontent.com/static/fonts/opensans/v7/PRmiXeptR36kaC0GEAetxp_TkvowlIOtbR7ePgFOpF4.ttf') format('truetype'); 
} 


@font-face { 
font-family: "open sans"; 
font-weight: 800; 
font-style: italic; 
src:  url('http://themes.googleusercontent.com/static/fonts/opensans/v7/PRmiXeptR36kaC0GEAetxlDMrAYtoOisqqMDW9M_Mqc.ttf') format('truetype'); 
} 

처럼 그리고 다음 나는에서 글꼴 가족 이름을 변경하려고 할 때 나는 웹 사이트

@import url(http://fonts.googleapis.com/css?family=Lato:300,400,700|Droid+Sans+Mono); 

@import url(http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800); 

@import url(http://fonts.googleapis.com/css?family=Bree+Serif); 

@import url(http://fonts.googleapis.com/css?family=Libre+Baskerville:400,700,400italic); 

@import url(http://fonts.googleapis.com/css?family=Philosopher:400,700,400italic,700italic|Droid+Sans+Mono|Roboto+Condensed:300italic,400italic,700italic,400,300,700|Roboto:400,100,300,100italic,300italic,400italic,500,500italic,700,700italic,900,900italic|EB+Garamond); 

@import url(http://fonts.googleapis.com/css?family=Inconsolata:400,700); 

@import url(http://fonts.googleapis.com/css?family=Dancing+Script:400,700); 

@import url(http://fonts.googleapis.com/css?family=Oxygen:400,300,700&subset=latin,latin-ext); 

@import url(http://fonts.googleapis.com/css?family=Merriweather:400,300,300italic,400italic,700,700italic,900,900italic); 

@import url(http://fonts.googleapis.com/css?family=Sorts+Mill+Goudy:400,400italic); 

@import url(http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300,300italic,700); 

에 소스 코드를 사용하고있는 방법입니다 사용자 스타일 시트와 소스 코드 모두에서 정확하게 '잘게 썬 것'을 '거칠게 분류'하는 것 '으로 분류합니다. 동일한 글꼴 - 가족 이름에 어떤 문제가있을 수 있습니까?

답변

0

WOFF 글꼴을 지원하는 latest version (0.12)을 사용해 볼 수 있습니다.

+0

Ohh Thanks..I가 방금 전에 게시 한 시간이 4 시간이 넘었습니다. –

+0

링크가 게시되는 대신 실제로 작동하면 (직접 테스트 한 경우) 도움이 될 것이라고 생각합니다. wkhtmltopdf를 개선하려는 노력은 크게 존경 받고 감사하게 생각합니다. – user1914292

관련 문제