小编bas*_*aus的帖子

@ font-face未嵌入移动版Safari(iPhone/iPad)

我使用@font-face(来自FontSquirrel的css)在移动网站上嵌入字体.当我在桌面Safari或Chrome中预览时,字体嵌入很好,但它们不会出现在iPhone/iPad上的移动Safari中.我没有得到任何错误,我无法弄清楚出了什么问题.这是我的CSS.有任何想法吗?

@font-face {
    font-family: 'JottingRegular';
    src: url('../fonts/jotting_regular-webfont.eot');
    src: local('?'),
         url('../fonts/jotting_regular-webfont.woff') format('woff'),
         url('../fonts/jotting_regular-webfont.ttf') format('truetype'),
         url('../fonts/jotting_regular-webfont.svg#webfonttEfFltbI') format('svg');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'JottingBold';
    src: url('../fonts/jotting_bold-webfont.eot');
    src: local('?'),
         url('../fonts/jotting_bold-webfont.woff') format('woff'), 
         url('../fonts/jotting_bold-webfont.ttf') format('truetype'), 
         url('../fonts/jotting_bold-webfont.svg#webfontJpUFTHYS') format('svg');
    font-weight: normal;
    font-style: normal;
}
Run Code Online (Sandbox Code Playgroud)

css iphone mobile-safari font-face ipad

15
推荐指数
2
解决办法
3万
查看次数

在python glob中支持扩展

我有python 2.7,我试图发出:

glob('{faint,bright*}/{science,calib}/chip?/')
Run Code Online (Sandbox Code Playgroud)

我没有获得匹配,但是从shell echo {faint,bright*}/{science,calib}/chip?给出:

faint/science/chip1 faint/science/chip2 faint/calib/chip1 faint/calib/chip2 bright1/science/chip1 bright1/science/chip2 bright1w/science/chip1 bright1w/science/chip2 bright2/science/chip1 bright2/science/chip2 bright2w/science/chip1 bright2w/science/chip2 bright1/calib/chip1 bright1/calib/chip2 bright1w/calib/chip1 bright1w/calib/chip2 bright2/calib/chip1 bright2/calib/chip2 bright2w/calib/chip1 bright2w/calib/chip2
Run Code Online (Sandbox Code Playgroud)

我的表情有什么问题?

python bash shell glob expansion

14
推荐指数
3
解决办法
3611
查看次数

ARIA属性用于在HTML中读取替代文本(例如罗马数字)

在我的HTML文档中,我使用的是罗马数字(例如:MMXV = 2015).

有没有办法通知屏幕阅读器以另一种方式解释某些文本(例如:罗马数字为"二千一十五"而不是MMXV)?

我的猜测是会有一个ARIA属性,但我似乎无法找到它.例如:

<time datetime="2015" aria-?="Two thousand and fifteen">MMXV</time>
Run Code Online (Sandbox Code Playgroud)

html5 accessibility wai-aria

8
推荐指数
1
解决办法
2399
查看次数

让Glob跟随Python中的符号链接

假设我有一个符号链接的子目录,如下所示:

subdir/
    folder/
        readme.txt
    symlink/ => ../hidden/
hidden/
    readme.txt
Run Code Online (Sandbox Code Playgroud)

如果我运行以下代码:

>>> from pathlib import Path
>>> list(Path('./subdir/').glob('**/readme.txt'))
Run Code Online (Sandbox Code Playgroud)

我希望结果是:

subdir/folder/readme.txt
subdir/symlink/readme.txt
Run Code Online (Sandbox Code Playgroud)

但是实际结果是:

subdir/folder/readme.txt
Run Code Online (Sandbox Code Playgroud)

我发现这是因为(出于某些未记录的原因)**运算符未遵循符号链接。

有没有办法实用地更改此配置?

python symlink python-3.x

6
推荐指数
2
解决办法
1692
查看次数

在SVG中裁剪和缩放图像

我的HTML中有一个SVG元素,它包含两个外部文件,另一个SVG和一个Bitmap.

<svg xmlns="http://www.w3.org/2000/svg"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    width="1024" height="768">
        <image xlink:href="bitmap.png" />
        <image xlink:href="outline.svg" />
</svg>
Run Code Online (Sandbox Code Playgroud)

我的目标是我可以将Bitmap换成另一个(任何大小)并使用Bitmap:

  1. 缩小到特定宽度(保持比率方面)
  2. 裁剪位图的底部部分

我已经尝试在封装位图图像的子SVG元素上使用clipPath,viewBox,我无法解决问题.我试图在没有JavaScript的情况下这样做(如果我可以帮助的话).

有什么想法吗?

css svg

5
推荐指数
1
解决办法
5839
查看次数

如何区分没有颜色的像素和黑色像素?

我正在使用ChunkyPNG来获取图像上的像素颜色.当图像完全没有背景颜色并渲染到浏览器中时,背景颜色将变为白色(通常取决于您的浏览器配置).

我的问题是,当用ChunkyPNG分析像素时,完全没有颜色rgb(0,0,0)的像素的值是,并且黑色像素的值是rgb(0,0,0).有什么方法可以区分它们吗?检查不透明度或...我缺少什么?

这是我的代码:

chunky_image = ChunkyPNG::Image.from_file("test.png")

width = chunky_image.dimension.width
height = chunky_image.dimension.height
(0..width - 1).each do |x|
  (0..height- 1).each do |y|
    red = ChunkyPNG::Color.r(chunky_image[x,y])
    green = ChunkyPNG::Color.g(chunky_image[x,y])
    blue = ChunkyPNG::Color.b(chunky_image[x,y])
    p "red: " + red.to_s
    p "green: " + green.to_s
    p "ble: " + blue.to_s
  end
end
Run Code Online (Sandbox Code Playgroud)

ruby image chunkypng

4
推荐指数
1
解决办法
656
查看次数

在GBDK C中转发typedef结构的声明

我正在使用GBDK C为原版Game Boy创建游戏,我遇到了一个小问题.我的游戏中的每个房间都需要有不同portals,但每个portal房间都需要参考一个房间.这是代码的缩减版本:

typedef struct {
    Portal portals[10];
} Room;

typedef struct {
    Room *destinationRoom;
} Portal;
Run Code Online (Sandbox Code Playgroud)

有关如何实现这一目标的任何建议?我尝试struct Portal;在文件顶部添加一个前向声明,但它没有帮助.


使用以下代码:

typedef struct Room Room;
typedef struct Portal Portal;

struct Room {
    Portal portals[10];
};

struct Portal {
    Room *destinationRoom;
};
Run Code Online (Sandbox Code Playgroud)

给我这个错误:

parse error: token -> 'Room' ; column 11
*** Error in `/opt/gbdk/bin/sdcc': munmap_chunk(): invalid pointer: 0xbfe3b651 ***
Run Code Online (Sandbox Code Playgroud)

c struct typedef gameboy gbdk

4
推荐指数
1
解决办法
310
查看次数

哪里有发展?并建造?在中间人 v4 中消失了

在中间人 3.0 版中,您已经能够使用变量development?build?模板。在 4.0 版中,这些变量不再存在。

如何识别当前运行的环境中间人?

environment middleman

3
推荐指数
1
解决办法
253
查看次数

将值从页面传递到木兰中的组件

如果我有一个我在页面中指定的变量:

<#assign myVar = "testing">

<@cms.area name="area-name"/>
Run Code Online (Sandbox Code Playgroud)

我希望能够在嵌套区域或组件中使用该变量,如何在应用程序中传递它?

<#list components as component>
    ${myVar}
</#list>
Run Code Online (Sandbox Code Playgroud)

java magnolia

0
推荐指数
1
解决办法
469
查看次数