GVKun编程网logo

html – MSIE 10,web字体和字体功能设置会导致不可见的文本(为什么html字体类型 设置没有用)

7

如果您想了解html–MSIE10,web字体和字体功能设置会导致不可见的文本和为什么html字体类型设置没有用的知识,那么本篇文章将是您的不二之选。我们将深入剖析html–MSIE10,web字体和

如果您想了解html – MSIE 10,web字体和字体功能设置会导致不可见的文本为什么html字体类型 设置没有用的知识,那么本篇文章将是您的不二之选。我们将深入剖析html – MSIE 10,web字体和字体功能设置会导致不可见的文本的各个方面,并为您解答为什么html字体类型 设置没有用的疑在这篇文章中,我们将为您介绍html – MSIE 10,web字体和字体功能设置会导致不可见的文本的相关知识,同时也会详细的解释为什么html字体类型 设置没有用的运用方法,并给出实际的案例分析,希望能帮助到您!

本文目录一览:

html – MSIE 10,web字体和字体功能设置会导致不可见的文本(为什么html字体类型 设置没有用)

html – MSIE 10,web字体和字体功能设置会导致不可见的文本(为什么html字体类型 设置没有用)

我认为这确实是Microsoft Internet Explorer 10中的一个错误,但我无法在任何地方找到任何解释.可以在 http://jsfiddle.net/37Bu5/找到问题的现场演示,这里是代码:
<html><head>
<style>
@import url("https://fonts.googleapis.com/css?family=Open+Sans:400");
.withkerning
{
    font-family: "Open Sans";
    font-feature-settings: "kern" 1;
}
</style>
</head><body>
<p>Here`s some example text 1.</p>
<p>Here`s some example text 2.</p>
</body></html>

问题是具有类withkerning的段落是完全不可见的.我想使用kern(字体中的字距)功能,因为它提高了可读性.

有关如何解决此问题的任何建议?据我所知,这与MSIE版本11.0,Firefox或Chrome无法重现.我更愿意避免使用JavaScript

>我使用JavaScript应用字体功能设置,因此如果浏览器足够快,我会得到难看的文本闪存而无需字距调整,或者
>我按原样保留CSS并尝试从MSIE 10中删除字体功能设置.任何试图使用MSIE 10查看内容的用户,如果没有启用JavaScript,将会得到一个缺少文本的页面.

解决方法

我的建议是删除font-feature-setting属性,因为它不会使文本更容易阅读.

原因是只有IE支持字体功能设置.所有其他浏览器都在删除该属性,因此非IE浏览器中的文本呈现没有变化.

WebKit和Blink浏览器支持使用webkit前缀的属性,Firefox支持moz前缀,但它们不支持jsfiddle中使用的无前缀.

如果您必须使用它而不是将其提供给IE,您可以添加moz和webkit前缀并删除无前缀版本,但请记住,它将永远不会在IE中使用此属性,并且如果它们将被删除在其他浏览器中永远删除他们的前缀版本.

注意:看起来使用此属性会使文本在Windows 7上的IE10和11中不可见,但在Windows 8.x上的IE10和11中可以正常工作.

Ajax 导致不可见的 <rich:collapsibleSubTable>

Ajax 导致不可见的

如何解决Ajax 导致不可见的 <rich:collapsibleSubTable>?

我想在表格行上实现一个加号按钮,当点击该按钮时,会在其下方显示其他信息。

我们的 UIProfile 类有这两个方法:

  private List<UIProfile> history = new LinkedList<>();

  private boolean isExpanded = false;

这是 xhtml

    <a4j:commandLink render="profileHistory">
        <h:graphicImage library="icons" name="obj16/plus.png" rendered="#{true}"/>
        <a4j:ajax event="click" listener="#{entity.flipExpanded}" execute="@form" render="profileHistory"/>
    </a4j:commandLink>

    ...

<rich:collapsibleSubTable id="profileHistory" value="#{entity.history}" expanded="#{entity.expanded}" var="hEntity">
    ...
</rich:collapsibleSubTable>

这是 flipExpanded 方法:

  public void flipExpanded() {
    isExpanded = !isExpanded;
    if(isExpanded) {
      final ProfileProvider provider = (ProfileProvider) this.provider;
      provider.setExpanded(this); // This method stores the id of the profiles in Set to track what''s open and what''s not
      provider.loadHistory(this); // This method queries and fill the List<UIProfile> history to show in the front end
    }
  }

经过大量调试,后端的数据似乎是一致的,但是rich:collapsibleSubTable总是display:none

代码是否可能没有按照我期望的顺序执行? (我是 Richfaces 的新手)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

C# 根据字体和字体类型获取相应宽度

C# 根据字体和字体类型获取相应宽度

using System.Windows.Forms

var gp = this.CreateGraphics(); var fontwidth = gp.MeasureString(orderCodeInfoTemp.Name, this.Font).Width;

cocoa – 在将HTML加载到NSTextView时设置默认字体和大小

cocoa – 在将HTML加载到NSTextView时设置默认字体和大小

我正在将一个简单的 HTML加载到NSTextView中.我已经为NSTextView设置了字体属性,但HTML的加载忽略了这些字体,默认情况下总是为’Times-Roman 12 size’.目前我正在枚举属性并设置字体大小.但这样做只是为了改变尺寸似乎很昂贵.这是唯一的方法吗?有没有更好的办法?

HTML:

<p>This is just a <b>title</b></p>

将HTML加载到NSTextView&随后更改fontsize:

NSData *valueInDataFormat = [bodyContent dataUsingEncoding:NSUTF8StringEncoding];
    NSAttributedString *textToBeInserted = [[NSAttributedString alloc] initWithHTML:valueInDataFormat documentAttributes:nil];

    NSDictionary *rtfTextAttributes = [self defaultTextAttributesFor:RTFText];
    //inserttext mimic what user do; so it takes the typingattributes
    //ref: http://www.cocoabuilder.com/archive/cocoa/113938-setting-default-font-of-an-nstextview.html#114071
    [entryContent setString:@""];
    [entryContent setTypingAttributes:rtfTextAttributes];
    [entryContent insertText:textToBeInserted];

    //Now change font size
            NSTextStorage *content = [entryContent textStorage];
            [content beginEditing];
            NSRange totalRange = NSMakeRange (0,content.length);

            [content enumerateAttributesInRange: totalRange
                                                 options: 0
                                              usingBlock: ^(NSDictionary *attributes,NSRange range,BOOL *stop) {
                                                  NSLog (@"range: %@  attributes: %@",NsstringFromrange(range),attributes);

                                                  NSFont *font = [attributes objectForKey:NSFontAttributeName];
                                                  if (font){
                                                      [content removeAttribute:NSFontAttributeName range:range];
                                                      font = [[NSFontManager sharedFontManager] convertFont:font toSize:[font pointSize] + 3];
                                                      [content addAttribute:NSFontAttributeName value:font range:range];
                                                  }
                                              }];
            [content endEditing];
            [entryContent didChangeText];

解决方法

最近遇到了这个问题,最后我发现可以使用< style>阻止HTML内容的前面,并将font-family设置为系统默认值.这很好用,并允许HTML在使用系统字体时描述所有粗体和斜体属性.

Nsstring* bodyContent = @"<p>This is just a <b>title</b></p>";

NSMutableString *htmlContent = [NSMutableString string];
[html appendString: @"<style>body { font-family: "];
[html appendString: [[NSFont systemFontOfSize: 12] fontName]];
[html appendString: @"; }</style>"];
[html appendString: bodyContent];

NSData *htmlData = [htmlContent dataUsingEncoding:NSUTF8StringEncoding];
NSAttributedString *html = [[NSAttributedString alloc] initWithHTML: htmlDescriptionData baseURL: NULL documentAttributes: NULL];

可能有一个更优雅的解决方案,但我还没有找到它.

css – 有没有办法在HTML电子邮件中使用Google Web字体?

css – 有没有办法在HTML电子邮件中使用Google Web字体?

HTML电子邮件必须(应该)内置CSS,以便在大多数电子邮件客户端中拥有预期的设计。

有没有办法将Google Web字体链接到这样的电子邮件中或嵌入在这样的电子邮件中,但仍然在电子邮件客户端之间保持广泛的接受(适当的渲染)?

我知道一个替代方案是使用相应排版的图像,但是我将首先搜索可能起作用的其他东西。

解决方法

如果字体是绝对必要的,您将不得不将文本作为图像解决方案。截至12月,只有iOS Mail,Mail.app,Lotus Notes 8,Android上的默认邮件,Outlook 2000和Thunderbird支持使用外部自定义字体。

看到:
http://www.campaignmonitor.com/blog/post/3897/using-web-fonts-in-email

编辑2/10/2014:由于这是我最受欢迎的答案之一,以下是电子邮件中网页字体最佳实践的更新链接:

http://www.campaignmonitor.com/resources/will-it-work/webfonts/

今天关于html – MSIE 10,web字体和字体功能设置会导致不可见的文本为什么html字体类型 设置没有用的介绍到此结束,谢谢您的阅读,有关Ajax 导致不可见的 、C# 根据字体和字体类型获取相应宽度、cocoa – 在将HTML加载到NSTextView时设置默认字体和大小、css – 有没有办法在HTML电子邮件中使用Google Web字体?等更多相关知识的信息可以在本站进行查询。

本文标签: