<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CSS &#8211; 任平生</title>
	<atom:link href="https://rpsh.net/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>https://rpsh.net</link>
	<description>待从头</description>
	<lastBuildDate>Sun, 15 Apr 2012 15:16:09 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.2.2</generator>
	<item>
		<title>在网站中使用微软雅黑字体是否会构成侵权？</title>
		<link>https://rpsh.net/archives/font-licensing-for-the-web/</link>
					<comments>https://rpsh.net/archives/font-licensing-for-the-web/#comments</comments>
		
		<dc:creator><![CDATA[任平生]]></dc:creator>
		<pubDate>Fri, 23 Mar 2012 11:45:07 +0000</pubDate>
				<category><![CDATA[技术分享]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Font]]></category>
		<category><![CDATA[版权]]></category>
		<guid isPermaLink="false">http://rpsh.net/?p=384</guid>

					<description><![CDATA[在网页的CSS中使用 font-family 定义字体为雅黑是否会构成侵权？ 根据微软的 EULA 及专门的答复邮件，这属于合法的使用范围，而不容许的情况是使用 @font-face 的方式引入 web字体。这也提醒我们，通过 CSS3 的 @font-face 在网页上引入 Web 字体是有风险的，尤其对于商业性网站。]]></description>
										<content:encoded><![CDATA[<p><a href="http://sofish.de/" target="_blank">sofish</a> 在知乎提了这么一个问题：</p>
<blockquote><p><a href="http://www.zhihu.com/question/20132460" target="_blank">在网站中使用微软雅黑会不会构成侵权？</a><br />
如果在网站的字体中使用 “微软雅黑”，在 CSS font-family 中（也就是说只有在系统默认有的时候才显示），不用在图片和外观设计上，会不会侵权？</p></blockquote>
<p>对于这个问题之前还真没想到过，很感兴趣，于是就做了一番查找。<br />
<span id="more-384"></span><br />
<img decoding="async" alt="" src="https://public.bay.livefilestore.com/y1pwUQB2tBHsYE8ZTKa4bKH1wxxVxMTrSmp5GAfpzCsHpmMwgM5bJDhgWZIsPWjcGRmSWyHRWWO0BF4Dljb2lQnwg/msyh.png?psid=1" title="微软雅黑字体" class="aligncenter" width="375" height="479" /></p>
<p>在微软雅黑字体文件的属性里，我们可以 EULA （最终用户许可协议）描述为：<br />
You may use this font as permitted by the EULA for the product in which this font is included to display and print content. You may only (i) embed this font in content as permitted by the embedding restrictions included in this font; and (ii) temporarily download this font to a printer or other output device to help print content. </p>
<p>中文大意：<br />
你可以依照包含这款字体的产品的 EULA 来使用此字体用来显示或打印内容。包含以下两种情况：<br />
1、当你要使用嵌入字体时需要遵循该字体的内嵌许可；<br />
2、临时性地下载到打印机或其他设备用于打印文档。</p>
<p>没有提到在网页上使用CSS 定义字体的情况，在 google 上了了一下，微软对于微软雅黑<a href="http://www.microsoft.com/typography/fonts/family.aspx?FID=350">字体授权</a>方面的一个网页，其中提供了一个联系方式可以询问对字体许可方面的疑问，于是就发了邮件询问。</p>
<p>二天后收到答复如下：</p>
<blockquote><p>Thank you for your inquiry. You should refer to your Windows license to understand the what rights Microsoft grants in their fonts.</p>
<p>Generally the license would allow you to use the font to use the font on workstations for your own personal or business use. The major restrictions in the EULA limit the fonts to be used on a certain number of workstations, prevent the fonts from being installed and used on a server, the fonts cannot be used with @font-face CSS, the font data cannot be modified and the font data cannot be distributed as part of a software or hardware product. You would need an additional license for these activities.</p>
<p>You can see the web fonts we offer at the link below:</p>
<p>http://webfonts.fonts.com/</p>
<p>Please let me know if you have any questions or if you want to extend the license for any of these uses.</p>
<p>Best regards,</p>
<p>Steve Kuhlman<br />
Monotype Imaging</p></blockquote>
<p>根据这篇回复，我们可以将字体用在个人或商业的工作站上。EULA 中主要的限制是不允许将字体安装在服务器上，不能使用 CSS 的 @font-face 的方式调用，及字体文件不能被修改或者作为软件一部分进行分发。这些都需要单独获得相应授权。</p>
<p>网上可以找到一篇 Adobe 的文章 <a href="http://blogs.adobe.com/typblography/2010/10/web-font-licensing.html" target="_blank">Understanding Web Font Licensing</a> ，其中讲了 Adobe 对字体也有相似的使用规定。</p>
<p><strong>所以，我们在 CSS 中使用 body{ font-family: &#8216;microsoft yahei&#8217; } 是在合法的使用范围内，不容许的是在CSS 中使用 @font-face 的方式引入字体文件。</strong></p>
<p>这也提醒我们，通过 CSS3 的 @font-face 在网页上引入 Web 字体是有风险的，尤其对于商业性网站。</p>
<p>对于个人站点，如果想使用有合法授权的 Web字体，可以访问这些：<br />
<a href="http://webfonts.fonts.com/" target="_blank">http://webfonts.fonts.com/</a><br />
<a href="https://typekit.com/" target="_blank">https://typekit.com/</a><br />
<a href="http://www.google.com/webfonts" target="_blank">http://www.google.com/webfonts</a></p>
<p><strong>3/29 更新</strong>:<br />
有趣的是，一周后又收到一封回复邮件，如下：</p>
<blockquote><p>Dear Haiyang,</p>
<p>Thanks a lot for your enquiry. Sorry for keep you waiting.<br />
After checking, you actually do not need a license to include the font name in your CSS, because it is only calling on the system font already existing in the end user&#8217;s computer, which does not need any extra license.</p>
<p>However, if you wish to know more about the licensing of this font, you need to contact Microsoft because they own the copyright of Yahei.</p>
<p>Should you have any queries, please do not hesitate to contact us.</p>
<p>Best Regards,</p>
<p>Janet Lau<br />
Sales Executive </p></blockquote>
<p>中心思想：经过核查，你不必担心在CSS 中使用字体名称，因为它仅仅是调用了终端用户自身系统中已经存在的字体，这不需要任何额外的授权许可。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://rpsh.net/archives/font-licensing-for-the-web/feed/</wfw:commentRss>
			<slash:comments>23</slash:comments>
		
		
			</item>
		<item>
		<title>CSS裸奔日</title>
		<link>https://rpsh.net/archives/2009-css-naked-day/</link>
					<comments>https://rpsh.net/archives/2009-css-naked-day/#comments</comments>
		
		<dc:creator><![CDATA[任平生]]></dc:creator>
		<pubDate>Wed, 08 Apr 2009 23:00:12 +0000</pubDate>
				<category><![CDATA[奇闻趣事]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Naked-day]]></category>
		<guid isPermaLink="false">http://rpsh.net/?p=245</guid>

					<description><![CDATA[CSS Naked Day，也称CSS裸奔节或CSS裸奔日，在裸奔节这天，参加裸奔节的Blog 将会去除页面上所有的 CSS 样式和广告裸奔整整一天,通过这个节日来重视CSS的重要性.CSS Naked Day 的目的:推动Web标准、提倡简洁为美、使用正确的 (x)html语义标记、良好的层次结构。暂时把页面设计抛弃，直接展示 body 内容！]]></description>
										<content:encoded><![CDATA[<p>据说，今天是 CSS 裸奔日  <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f62e.png" alt="😮" class="wp-smiley" style="height: 1em; max-height: 1em;" /> </p>
<blockquote>
<h3>CSS Naked Day 的来历</h3>
<p><a title="CSS Naked Day的发起者页面" class="external" href="http://naked.dustindiaz.com/" target="_blank">CSS Naked Day</a>，也称CSS裸奔节或CSS裸奔日，</p>
<p>在裸奔节这天，参加裸奔节的Blog 将会去除页面上所有的 CSS 样式和广告裸奔整整一天,通过这个节日来重视CSS的重要性.当然你的网站如果是用table来布局的话这个节日对你来说并不是很合适.在2006年有将近800个国际知名网站参与这个节日.</p>
<h3>CSS Naked Day 的目的</h3>
<p>推动Web标准、提倡简洁为美、使用正确的 (x)html语义标记、良好的层次结构。暂时把页面设计抛弃，直接展示&lt;body&gt;内容！</p>
<p>&#8212; <a class="external" href="http://blog.taoxian.info/2009-css-naked-day.html"  target="_blank">via</a></p>
</blockquote>
]]></content:encoded>
					
					<wfw:commentRss>https://rpsh.net/archives/2009-css-naked-day/feed/</wfw:commentRss>
			<slash:comments>16</slash:comments>
		
		
			</item>
		<item>
		<title>根据时间调用不同的CSS文件</title>
		<link>https://rpsh.net/archives/how-to-change-css-according-to-time/</link>
					<comments>https://rpsh.net/archives/how-to-change-css-according-to-time/#comments</comments>
		
		<dc:creator><![CDATA[任平生]]></dc:creator>
		<pubDate>Mon, 22 Dec 2008 01:00:00 +0000</pubDate>
				<category><![CDATA[技术分享]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[原创]]></category>
		<guid isPermaLink="false">http://rpsh.net/archives/how-to-change-css-according-to-time/</guid>

					<description><![CDATA[iGoogle 和新发布的 Windows Live Wave3 中都有根据时间调用不同CSS样式的动态主题，想不想也将此效果里用到自己 Blog 上，使用 PHP 函数只需一个小小的修改就可以根据时间调用不同的CSS文件啦]]></description>
										<content:encoded><![CDATA[<p>iGoogle 和新发布的 Windows Live <a href="https://rpsh.net/tag/wave3/">Wave3</a> 中都有根据时间调用不同CSS样式的动态主题，想不想也将此效果里用到自己 Blog 上，只需一个小小的<a href="https://rpsh.net/archives/how-to-change-css-according-to-time/">修改</a>就可以做到啦 <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f600.png" alt="😀" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p><span id="more-206"></span></p>
<p>示例：</p>
<pre><code class="php">&lt;?php ini_set(&quot;date.timezone&quot;,&quot;Asia/Shanghai&quot;); $hc = date(&quot;H&quot;);
  if($hc &gt;= 7 &amp;&amp; $hc &lt; 18)
  echo '&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;https://rpsh.net/<span style="color: #ff8040">day.css</span>&quot; media=&quot;screen&quot; /&gt;';
  else
  echo '&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;https://rpsh.net/<span style="color: #ff8040">night.css</span>&quot; media=&quot;screen&quot; /&gt;';
?&gt;</code></pre>
<p>鉴于大多数同学都租用的米国的虚拟主机，所以开始加上一句 ini_set(&quot;date.timezone&quot;,&quot;Asia/Shanghai&quot;) 来让时间设定为咱中国时间，剩下的就很好理解了，7点到18点为白天调用 day.css&#160; 文件，18点到次日7点为夜间调用 night.css 文件。</p>
<p>具体到我们 WordPress ，你可能就要修改你主题 header.php 文件中的调用CSS 文件的部分： </p>
<pre><code class="php">&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;&lt;?php bloginfo('stylesheet_url'); ?&gt;&quot; media=&quot;screen&quot; /&gt;</code></pre>
<p>为： </p>
<pre><code class="php">&lt;?php ini_set(&quot;date.timezone&quot;,&quot;Asia/Shanghai&quot;); $hc = date(&quot;H&quot;);
  if($hc &gt;= 7 &amp;&amp; $hc &lt; 18)
  echo '&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;';<br />  echo bloginfo('stylesheet_directory'); <br />  echo '/<span style="color: #ff8040">day</span>.css&quot;';
  else
  echo '/<span style="color: #ff8040">night</span>.css&quot;'<br />  echo 'media=&quot;screen&quot; /&gt;';
?&gt;</code></pre>
<p>* 你需要编写一个 day.css 和一个 night.css 的文件放在你的主题文件夹里。</p>
<p>如果像本 <a href="https://rpsh.net/">Blog</a> 一样只是按时间显示不同的 banner 或 背景图片，CSS文件的其他地方都相同的话，CSS的调用保持不便，只需在你主题 header.php 文件的 &lt;/head&gt;&#160; 之前加入下边的代码即可</p>
<pre><code class="php">&lt;style type=&quot;text/css&quot;&gt;
  body{background: url(&lt;?php ini_set(&quot;date.timezone&quot;,&quot;Asia/Shanghai&quot;); $hc = date(&quot;H&quot;);
  if($hc &gt;= 6 &amp;&amp; $hc &lt; 9)
  echo '图片地址一';
  else if($hc &gt;= 9 &amp;&amp; $hc &lt; 18)
  echo '图片地址一';
  else
  echo '图片地址三';
  ?&gt;) no-repeat scroll center top;}
&lt;/style&gt;</code></pre>
<p>类似的，你还可以写出 早上好，下午好，晚上好 之类的欢迎语~~</p>
<p>如果要根据访问用户的系统时间来做判断的话，就有点麻烦了，需要用 js 来返回用户时间，对这个有要求的，可以请教最近玩 js 走火入魔的 <a target="_blank" href="http://ishawn.net/" class="external">Shawn</a> 大师 <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f61b.png" alt="😛" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://rpsh.net/archives/how-to-change-css-according-to-time/feed/</wfw:commentRss>
			<slash:comments>35</slash:comments>
		
		
			</item>
	</channel>
</rss>
