- objective-c - iOS 5 : Can you override UIAppearance customisations in specific classes?
- iphone - 如何将 CGFontRef 转换为 UIFont?
- ios - 以编程方式关闭标记的信息窗口 google maps iOS
- ios - Xcode 5 - 尝试验证存档时出现 "No application records were found"
如果用户的计算机上安装了“Segoe UI”字体,我想在网站中使用它。
我已经用 @font-face
声明了所有样式,以便使用 font-weight
属性来更改字体的粗细(这是一个非常酷的功能!)。
问题是我无法使用 Segoe UI Bold(我认为名称有误)。有什么想法吗?
举个例子。 (4) 和 (5) 是一样的:http://jsfiddle.net/kxHQR/1/
@font-face {
font-family: 'Myname';
font-style: normal;
font-weight: 700;
src: local('Segoe UI Bold'), local('SegoeUI-bold'), local('segoeuib');
}
@font-face {
font-family: 'Myname';
font-style: normal;
font-weight: 600;
src: local('Segoe UI Semibold'), local('SegoeUI-Semibold');
}
@font-face {
font-family: 'Myname';
font-style: normal;
font-weight: 400;
src: local('Segoe UI'), local('SegoeUI');
}
@font-face {
font-family: 'Myname';
font-style: normal;
font-weight: 300;
src: local('Segoe UI Light'), local('SegoeUI-Light');
}
/* ... */
BODY {
font-family: 'Myname';
}
.boldtext {
font-family:'Segoe UI';
font-weight:700;
}
<p style='font-weight:300'>1. Text with font-weight:300. OK</h1>
<p>2. Here is normal text. OK</p>
<p style='font-weight:600'>3. Text with font-weight:600. OK</p>
<p style='font-weight:700' >4. Text with font-weight:700. It must be like (5), but it is like (3). :(</p>
<p class='boldtext'>5. Text with font-family:'Segoe UI' (no font-face) and font-weight:700; </p>
最佳答案
这个来自微软自己的stylesheet for Windows 8 (Metro) apps :
/*
Explicitly define a Segoe UI font-family so that we can assign Segoe UI
Semilight to an appropriate font-weight.
*/
@font-face {
font-family: "Segoe UI";
font-weight: 200;
src: local("Segoe UI Light");
}
@font-face {
font-family: "Segoe UI";
font-weight: 300;
src: local("Segoe UI Semilight");
}
@font-face {
font-family: "Segoe UI";
font-weight: 400;
src: local("Segoe UI");
}
@font-face {
font-family: "Segoe UI";
font-weight: 600;
src: local("Segoe UI Semibold");
}
@font-face {
font-family: "Segoe UI";
font-weight: 700;
src: local("Segoe UI Bold");
}
@font-face {
font-family: "Segoe UI";
font-style: italic;
font-weight: 400;
src: local("Segoe UI Italic");
}
@font-face {
font-family: "Segoe UI";
font-style: italic;
font-weight: 700;
src: local("Segoe UI Bold Italic");
}
上述方法适用于我,也是 Open Sans 和 Google 字体 使用的方法。然而,它与 this 正好相反。方法,最初来自 Paul Irish:
@font-face {
font-family: 'ChunkFiveRegular;
src: url('whatever source');
font-weight: normal;
font-style: normal;
}
Paul Irish 的方法允许(读作:要求)稍后在 CSS 中设置粗细和斜体,但结果是“虚假的”:由于浏览器没有家族中的所有字体,它必须计算粗细和斜体 Angular 色本身的形状来弥补这一点。 Paul 方法的单一且有限的优势在于它可能在所有浏览器中重置字体 - 但它确实取决于所使用的字体 - 因为所有浏览器呈现的字体都不同!
我更喜欢微软的方法,因为它允许指定你需要的font-style
和font-weight
,浏览器会显示正确的字体文件,而不是计算人造尺寸、粗体和斜体。但是,它确实要求您为将要使用的系列中的每个字体变体提供一个字体文件。
最后,一切都归结为您要使用的字体以及使用方式(不同粗细、斜体等)。无论您采用哪种方法,我都建议根据我自己的经验(以及 Paul recommends 也是)使用 FontSquirrel's font-face generator为您所有的网页排版工作。 FontSquirrel 可以通过删除不必要的字符集、压缩字体等方式显着减小字体大小。
关于css - 'Segoe UI' 字体与字体和本地,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13187044/
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 11 个月前关闭。 Improve
我想将 Segoe UI 字体添加到 Google 条形图。我尝试使用 fontName 属性添加它。但它在“网络”选项卡中显示错误。在控制台中打印此错误: 加载资源失败:服务器响应状态为 400 (
我目前正在 Silverlight 4 中构建 LOB 应用程序。我一直在考虑应用程序的排版问题。 经过设计方面的一些实验,人们喜欢的字体是 Segoe UI。现在我可以嵌入这种字体,尽管该字体可在
如果用户的计算机上安装了“Segoe UI”字体,我想在网站中使用它。 我已经用 @font-face 声明了所有样式,以便使用 font-weight 属性来更改字体的粗细(这是一个非常酷的功能!)
编辑: 下面是我的 XML 格式。它包含我的 IconSheet 的数据。我只放了一个图标十六进制值作为示例。 uE101 1 这是我的代码片段 private voi
我有一些 Web 应用程序遵循 Microsoft 的 Metro 风格(即:new outlook)。但是我使用的字体有问题。默认字体是“Segoe”系列,当用户在具有桌面字体Segoe UI的系统
这个问题在这里已经有了答案: Using @font-face for Segoe UI font [closed] (4 个答案) 关闭 8 年前。
Windows 8 带有新字体 Segoe UI Symbol。该字体在 U+E000 - U+EF013 范围内有许多图标,可在为 Windows 商店构建应用程序时用作按钮。 这些符号的名称列表在
我正在尝试将 Segoe UI 符号字体中的字形用于 Windows Phone 8.1 应用程序,但无法使其正常工作。 关于this 页面(向底部)它定义了一个锁定和解锁字形,分别带有字符:U+E1
我们正在构建一个 WPF 应用程序,并且想要动态图标(无损失缩放和自定义颜色)。 我遇到过像 http://modernuiicons.com/ 这样的网站和 http://www.thexamlpr
我在使用 Segoe UI 字体的 Windows API DrawText 调用绘制文本时遇到一个问题: 此图演示了该问题:指定的文本在指定的矩形中向右移动了一点,因此最后一个字符被剪掉(最好的例子
我正在使用 xaml 通用项目,在转换为隐藏代码中的字符串后,显示 Segoe MDL2 Assets 字体的某些字符时出现问题。请查看图片和任何有想法的人如何解决此问题: Xaml:
我有一个介于 100-500 之间的数值,它每秒左右变化一次。因为 Segoe WP 的数字字符是可变宽度的,所以文本改变时会跳转。 在 XAML 文件中使用 Segoe WP 字体;有没有办法用等宽
我正在尝试为我的 tkinter GUI 提供现代的外观。这是我正在使用的语法,但没有任何运气。任何帮助都会非常有帮助! from Tkinter import * my_font=("Segoe U
有没有人能够向 Windows 7 用户发布 wpf 应用程序并使用这种字体?我到处都看了看,看不到解决方案。我已经下载了字体系列并将其作为资源放置在我的项目中 FontFamily="/Helpde
我学习 Windows Phone 编程。自从拿到Lumia 610(WP7.8)之后,我就用7.1 SDK来写。问题是我希望我的应用程序将字符串与箭头符号连接起来,该符号在 Segoe UI Sym
浏览器是否内置了 Segoe UI 字体?如果我的访问者正在从 Mac 查看,它会正常工作还是我必须为此设置 CSS url?我的设计师说只有当我们设置 URL 时它才会起作用,但是我删除了 @fon
我正在尝试将 PlayerFramework.MediaPlayer.CanPause 属性绑定(bind)到我的 Windows 10 通用应用程序中的按钮。这使用默认字体,但是当我切换到 Sego
看起来很简单,但我不知道如何做/使用 these符号。我想使用 U+E135 符号,但我不知道该怎么做。有人可以给我一个 TextBlock 示例,并解释我如何获得在 XAML 中使用的等效十六进制。
我正在使用 Delphi 10 Seattle 开发 Android 应用程序。我的 Segoe UI 字体 遇到了这个奇怪的问题。(其他字体也会出现同样的问题,但就我而言,我想使用 Segoe UI
我是一名优秀的程序员,十分优秀!