Thread: half star
View Single Post
Old 09-28-2016, 03:24 AM   #6
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,742
Karma: 24031403
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by BetterRed View Post
Maybe Kovid has pre-empted acceptance of Ken Shirriff's proposal and he's using the HalfStarDemo.ttf - that might be it, the timing fits. He's had a lot of requests for half-stars.
The method suggested in this Stackoverflow thread also appears to be working with stars. However, it requires pseudo selector support.

Here's a proof of concept code:

Spoiler:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style>
.content {
    position: relative;
    font-size: 50px;
}

.content:after {
    position: absolute;
    overflow: hidden;
    content: "★";
    color: white;
}
.left .content:after {
    top: 0;
    left: 0;
    width: .50em;
}
</style>


</head>
<body>
<div class="left">Half star with pseudo elements: <span class="content">★</span></div>
</body>
</html>


Here's what it looks like in Sigil (and Calibre):

Doitsu is offline   Reply With Quote