Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

사용자가 구글 웹폰트 자유롭게 선택할 수 있게 하기 #326

Open
lens0021 opened this issue Dec 10, 2019 · 4 comments
Open
Labels
enhancement New feature or request

Comments

@lens0021
Copy link
Member

lens0021 commented Dec 10, 2019

확장기능 TemplateStyles에는 @font-face 사용에 몇 가지 제약 사항이 있는데, font-family가 반드시 "TemplateStyles"로 시작해야 한다는 점과 src: url()에는 $wgTemplateStylesAllowedUrls['font']에서 미리 지정한 (PCRE)정규식에 해당하는 값만 들어갈 수 있다는 것이 그것입니다.

요청에 따라 구글 웹폰트를 사용할 수 있게 하기 위해 LocalSettings.php에서 다음을 선언하면

$wgTemplateStylesAllowedUrls = [
	"font" => [
		"<^https://fonts\\.googleapis\\.com/css(?:[?#]|$)>"
	],
];

Sanitized CSS에 다음을 정의해서 사용할 수 있어집니다. (대문자는 교체)

@font-face {
  font-family: "TemplateStyles FONT_NAME";
  src: local('FONT_NAME'), url("URL") format('woff2');
}
@lens0021 lens0021 added the enhancement New feature or request label Dec 10, 2019
@lens0021 lens0021 self-assigned this Dec 10, 2019
@lens0021 lens0021 added this to To do in femiwiki.com via automation Dec 10, 2019
femiwiki.com automation moved this from To do to Done Dec 10, 2019
@lens0021 lens0021 changed the title TemplateStyles에서 웹폰트 지원 TemplateStyles에서 구글 웹폰트 지원 Dec 11, 2019
@lens0021
Copy link
Member Author

아직 안됩니다

@lens0021 lens0021 reopened this Dec 13, 2019
femiwiki.com automation moved this from Done to To do Dec 13, 2019
@lens0021
Copy link
Member Author

FYI: @Import AtRule은 화이트리스트가 안 되어 있습니다. https://github.com/wikimedia/mediawiki-extensions-TemplateStyles/blob/f121c39/includes/TemplateStylesHooks.php#L168

@simnalamburt
Copy link
Member

이런 저런 방법을 알아봤는데 구글폰트 확장기능을 만드는게 제일 쉬울것같습니다

@lens0021
Copy link
Member Author

레퍼런스

@lens0021 lens0021 changed the title TemplateStyles에서 구글 웹폰트 지원 사용자가 구글 웹폰트 자유롭게 선택할 수 있게 하기 Feb 16, 2020
@lens0021 lens0021 removed their assignment Feb 18, 2020
femiwiki.com automation moved this from To do to Done Mar 20, 2020
@lens0021 lens0021 reopened this Mar 20, 2020
femiwiki.com automation moved this from Done to To do Mar 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: To do
femiwiki.com
  
To do
Development

No branches or pull requests

2 participants