Skip to content
Open
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
9 changes: 6 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { ipcMain } from 'electron';
import Jimp from 'jimp';

// Hardcoded constants
const blockSize = 8;
const blockSize = 8; // 4
const fontSize = 32; // 24
const font = "Arial" // Consolas
const letterSpacing = "normal"; // -0.2

var mainWindow: any = null
var redacted_image: any = null
Expand Down Expand Up @@ -189,7 +192,7 @@ async function redact(message: any) {
data:text/html;charset=utf-8, \
<HTML/> \
<body style=\"padding: 8px 0px 0px 8px; background-color:white;\"> \
<span style=\"padding 0px 0px 0px 0px; font-weight: normal; line-spacing: 0px; word-spacing: 0px; white-space: pre; margin: 0; font-size: 32px; font-family:'Arial'\">XYZXYZ</span><span style=\"padding 0px 0px 0px 0px; margin: 0; color: blue; font-size: 32px; font-family:'Arial'\">█</span> \
<span style=\"padding 0px 0px 0px 0px; font-weight: normal; line-spacing: 0px; word-spacing: 0px; letter-spacing: " + letterSpacing + "; white-space: pre; margin: 0; font-size: " + fontSize + "px; font-family:'Arial'\">XYZXYZ</span><span style=\"padding 0px 0px 0px 0px; margin: 0; color: blue; font-size: " + fontSize + "px; font-family:'" + font + "'\">█</span> \
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line still explicitly defines "Arial" as the font family.

</body> \
</HTML> \
"
Expand All @@ -202,7 +205,7 @@ async function redact(message: any) {

await Jimp.read(imageData).then(async (image) => {
// Find the blue line that demarks the end of the guess string
var margins = await getBlueMargin(image)
var margins = await getBlueMargin(image);
var blueMargin = margins[0];
var imageCenter = margins[1];

Expand Down