Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Free Ruler.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
50B1D3532D05D00100B1D135 /* RulerCursorController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50B1D3522D05D00100B1D135 /* RulerCursorController.swift */; };
50B1D3552D05E00000B1D138 /* RulerTickLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50B1D3542D05E00000B1D138 /* RulerTickLayout.swift */; };
50B1D3592D06000100B1D139 /* AppIconRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50B1D3582D06000100B1D139 /* AppIconRenderer.swift */; };
50B1D3602D06000600B1D139 /* AppIconGenerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50B1D35F2D06000600B1D139 /* AppIconGenerator.swift */; };
50B1D35D2D06000400B1D139 /* AppIconRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50B1D3582D06000100B1D139 /* AppIconRenderer.swift */; };
50B1D3602D06000600B1D139 /* AppIconGenerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50B1D35F2D06000600B1D139 /* AppIconGenerator.swift */; };
50B1D3612D06000700B1D139 /* AppIconGenerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50B1D35F2D06000600B1D139 /* AppIconGenerator.swift */; };
50B1D3652D06010100B1D139 /* AppStoreScreenshotPreview.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50B1D3642D06010100B1D139 /* AppStoreScreenshotPreview.swift */; };
50B1D3662D06010200B1D139 /* AppStoreScreenshotPreview.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50B1D3642D06010100B1D139 /* AppStoreScreenshotPreview.swift */; };
Expand Down Expand Up @@ -142,7 +142,7 @@
8F629823243003EA004F9099 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/MainMenu.strings; sourceTree = "<group>"; };
8F629825243003F6004F9099 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/PreferencesController.xib; sourceTree = "<group>"; };
8F629828243003FF004F9099 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/PreferencesController.strings; sourceTree = "<group>"; };
AB053EE93E1DC9AF341A8D4F /* Free Ruler.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; name = "Free Ruler.app"; path = "Free Ruler.app"; sourceTree = BUILT_PRODUCTS_DIR; };
AB053EE93E1DC9AF341A8D4F /* Free Ruler.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Free Ruler.app"; sourceTree = BUILT_PRODUCTS_DIR; };
B894A5002BBFE61A005A3B6F /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/MainMenu.strings; sourceTree = "<group>"; };
B894A5012BBFE61A005A3B6F /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/PreferencesController.strings; sourceTree = "<group>"; };
D9DBE8A12C791B1600A42589 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/MainMenu.strings; sourceTree = "<group>"; };
Expand Down
1 change: 0 additions & 1 deletion Free Ruler/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ class AppDelegate: NSObject, NSApplicationDelegate {
#endif

showRulers()

}

#if DEBUG
Expand Down
6 changes: 3 additions & 3 deletions Free Ruler/FreeRuler.help/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1</string>
<string>2.0.17</string>
<key>CFBundleSignature</key>
<string>hbwr</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>491</string>
<key>HPDBookAccessPath</key>
<string>FreeRuler.html</string>
<key>HPDBookIconPath</key>
<string></string>
<key>HPDBookIndexPath</key>
<string>English.lproj.helpindex</string>
<key>HPDBookKBProduct</key>
<string>freeruler1</string>
<string>freeruler2.0.17</string>
<key>HPDBookTitle</key>
<string>Free Ruler Help</string>
<key>HPDBookType</key>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,39 +1,107 @@
<!doctype html>
<html>

<head>
<meta charset="UTF-8">
<title>Free Ruler Help</title>
<link rel="stylesheet" href="../shrd/styles.css"/>
<meta name="keywords" content="free ruler, shortcuts, keyboard, float, group, preferences"/>
<meta name="description" content="Free Ruler Help"/>
<meta name="robots" content="anchors"/>
<meta name="robots" content="keywords"/>
<link rel="stylesheet" href="../shrd/styles.css?icon=20260614005548-cabbb6a756bb" />
<style>
:root {
--free-ruler-help-icon: url("../shrd/freeruler-help-icon-20260614005548-cabbb6a756bb.png");
}
</style>
<meta name="keywords"
content="free ruler, rulers, shortcuts, keyboard, float, group, shadow, origin, units, color, preferences" />
<meta name="description" content="Free Ruler Help" />
<meta name="robots" content="anchors" />
<meta name="robots" content="keywords" />
</head>

<body>

<a name="WelcomePage"></a>

<h1 class="title-page-header">
Free Ruler Help
</h1>

<h2>
Keyboard Shortcuts
</h2>

<table class="keyboard-shortcuts">
<tbody>
<tr><th></th><th>F</th><td>Float/unfloat rulers above other windows</td></tr>
<tr><th></th><th>G</th><td>Group/ungroup rulers</td></tr>
<tr><th></th><th>S</th><td>Show/hide ruler shadows</td></tr>
<tr><th></th><th>O</th><td>Orient rulers at mouse location</td></tr>
<tr><th></th><th>U</th><td>Cycle units: pixels, millimeters, and inches</td></tr>
<tr><th>⇧</th><th>H</th><td>Flip the horizontal ruler origin</td></tr>
<tr><th>⇧</th><th>V</th><td>Flip the vertical ruler origin</td></tr>
<tr><th>⌘</th><th>R</th><td>Reset ruler positions to default</td></tr>
<tr><th>⌘</th><th>,</th><td>Open Preferences</td></tr>
</tbody>
</table>
<a name="WelcomePage"></a>

<h1 class="title-page-header">
Free Ruler Help
</h1>

<h2>
Keyboard Shortcuts
</h2>

<table class="keyboard-shortcuts">
<tbody>
<tr>
<th></th>
<th>H</th>
<td>Hide or show the horizontal ruler</td>
</tr>
<tr>
<th></th>
<th>V</th>
<td>Hide or show the vertical ruler</td>
</tr>
<tr>
<th>⇧</th>
<th>H</th>
<td>Flip the horizontal ruler origin</td>
</tr>
<tr>
<th>⇧</th>
<th>V</th>
<td>Flip the vertical ruler origin</td>
</tr>
<tr>
<th></th>
<th>F</th>
<td>Float/unfloat rulers above other windows</td>
</tr>
<tr>
<th></th>
<th>G</th>
<td>Group/ungroup rulers</td>
</tr>
<tr>
<th></th>
<th>S</th>
<td>Show/hide ruler shadows</td>
</tr>
<tr>
<th></th>
<th>O</th>
<td>Orient rulers at mouse location</td>
</tr>
<tr>
<th></th>
<th>U</th>
<td>Cycle units: pixels, millimeters, and inches</td>
</tr>
<tr>
<th>⌘</th>
<th>R</th>
<td>Reset ruler positions to default</td>
</tr>
<tr>
<th>⌘</th>
<th>,</th>
<td>Open Preferences</td>
</tr>
</tbody>
</table>

<h2>
Features
</h2>

<ul class="features">
<li>Show horizontal and vertical rulers in pixels, millimeters, or inches.</li>
<li>Resize rulers, move them independently, or keep them grouped together.</li>
<li>Customize the ruler color in Preferences.</li>
<li>Float rulers above other windows and show or hide ruler shadows.</li>
<li>Align rulers at the mouse location, reset them to default positions, or flip their origins.</li>
<li>Show, hide, and reopen rulers from the menu or keyboard.</li>
</ul>

</body>

</html>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
15 changes: 14 additions & 1 deletion Free Ruler/FreeRuler.help/Contents/Resources/shrd/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif;
}

h2 {
margin-top: 40px;
}

.title-page-header {
background-image: url(./freeruler.png);
background-image: var(--free-ruler-help-icon);
background-size: 200px 200px;
background-repeat: no-repeat;
padding-top: 220px;
Expand All @@ -20,3 +24,12 @@ body {
text-align: left;
padding-left: 10px;
}

.features {
margin-top: 0;
padding-left: 22px;
}

.features li {
margin-bottom: 8px;
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"get:version": "node -p \"require('./package.json').version\"",
"get:commits": "git log --pretty=oneline | wc -l",
"generate:icons": "scripts/generate-app-icon.sh",
"generate:help": "scripts/generate-help-index.sh",
"generate:screenshots": "scripts/generate-app-store-screenshots.sh",
"bump:version": "node scripts/release/bump-version.js",
"release:version": "node scripts/release/set-version.js",
Expand Down
22 changes: 22 additions & 0 deletions scripts/generate-app-icon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ set -euo pipefail
cd "$(dirname "$0")/.."

output_dir="$PWD/Free Ruler/Images.xcassets/AppIcon.appiconset"
help_resource_dir="$PWD/Free Ruler/FreeRuler.help/Contents/Resources"
help_shared_dir="$help_resource_dir/shrd"
help_html="$help_resource_dir/English.lproj/FreeRuler.html"
binary="${TMPDIR:-/tmp}/freeruler-generate-app-icon"
module_cache="${TMPDIR:-/tmp}/freeruler-generate-app-icon-module-cache"

Expand All @@ -16,3 +19,22 @@ xcrun swiftc \
-o "$binary"

"$binary" "$output_dir"

icon_hash="$(shasum -a 256 "$output_dir/icon_512x512.png" | awk '{ print substr($1, 1, 12) }')"
generated_at="$(date -u +%Y%m%d%H%M%S)"
help_cache_token="${generated_at}-${icon_hash}"
help_icon_name="freeruler-help-icon-${help_cache_token}.png"
help_icon="$help_shared_dir/$help_icon_name"

cp "$output_dir/icon_512x512.png" "$help_icon"

for stale_icon in "$help_shared_dir"/freeruler-help-icon-*.png; do
if [[ -e "$stale_icon" && "$stale_icon" != "$help_icon" ]]; then
rm "$stale_icon"
fi
done

HELP_ICON_NAME="$help_icon_name" HELP_CACHE_TOKEN="$help_cache_token" perl -0pi -e \
's#href="\.\./shrd/styles\.css(?:\?[^"]*)?"#href="../shrd/styles.css?icon=$ENV{HELP_CACHE_TOKEN}"#;
s#--free-ruler-help-icon: url\("[^"]+"\);#--free-ruler-help-icon: url("../shrd/$ENV{HELP_ICON_NAME}");#' \
"$help_html"
9 changes: 9 additions & 0 deletions scripts/generate-help-index.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -euo pipefail

cd "$(dirname "$0")/.."

help_lproj_dir="$PWD/Free Ruler/FreeRuler.help/Contents/Resources/English.lproj"
help_index="$help_lproj_dir/English.lproj.helpindex"

hiutil -I lsm -C -ag -s en -f "$help_index" "$help_lproj_dir"