Skip to content

Commit

Permalink
fix: font on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
louis030195 committed Aug 1, 2024
1 parent 5e7a45a commit 5a6ae97
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 7 deletions.
4 changes: 1 addition & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ members = [
"screenpipe-vision",
"screenpipe-audio",
"screenpipe-server",

]
exclude = [
"examples/apps/screenpipe-app-tauri/src-tauri",

"examples/apps/screenpipe-app-tauri/src-tauri",
]
resolver = "2"

Expand Down
2 changes: 1 addition & 1 deletion examples/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "screenpipe-app"
version = "0.1.7"
version = "0.1.8"
description = ""
authors = ["you"]
license = ""
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -6449,6 +6449,13 @@
"window:allow-set-size"
]
},
{
"description": "window:allow-set-size-constraints -> Enables the set_size_constraints command without any pre-configured scope.",
"type": "string",
"enum": [
"window:allow-set-size-constraints"
]
},
{
"description": "window:allow-set-skip-taskbar -> Enables the set_skip_taskbar command without any pre-configured scope.",
"type": "string",
Expand Down Expand Up @@ -6897,6 +6904,13 @@
"window:deny-set-size"
]
},
{
"description": "window:deny-set-size-constraints -> Denies the set_size_constraints command without any pre-configured scope.",
"type": "string",
"enum": [
"window:deny-set-size-constraints"
]
},
{
"description": "window:deny-set-skip-taskbar -> Denies the set_skip_taskbar command without any pre-configured scope.",
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6449,6 +6449,13 @@
"window:allow-set-size"
]
},
{
"description": "window:allow-set-size-constraints -> Enables the set_size_constraints command without any pre-configured scope.",
"type": "string",
"enum": [
"window:allow-set-size-constraints"
]
},
{
"description": "window:allow-set-skip-taskbar -> Enables the set_skip_taskbar command without any pre-configured scope.",
"type": "string",
Expand Down Expand Up @@ -6897,6 +6904,13 @@
"window:deny-set-size"
]
},
{
"description": "window:deny-set-size-constraints -> Denies the set_size_constraints command without any pre-configured scope.",
"type": "string",
"enum": [
"window:deny-set-size-constraints"
]
},
{
"description": "window:deny-set-skip-taskbar -> Denies the set_skip_taskbar command without any pre-configured scope.",
"type": "string",
Expand Down
18 changes: 17 additions & 1 deletion examples/apps/screenpipe-app-tauri/src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ async fn spawn_screenpipe(

fn spawn_sidecar(app: &tauri::AppHandle) -> Result<CommandChild, String> {
let sidecar = app.shell().sidecar("screenpipe").unwrap();

// Get the current settings
let stores = app.state::<StoreCollection<Wry>>();
let base_dir = get_base_dir(None).expect("Failed to ensure local data directory");
Expand All @@ -127,6 +126,23 @@ fn spawn_sidecar(app: &tauri::AppHandle) -> Result<CommandChild, String> {
args.push("--cloud-audio-off");
}

// hardcode TESSDATA_PREFIX for windows
if cfg!(windows) {
let exe_dir = env::current_exe()
.expect("Failed to get current executable path")
.parent()
.expect("Failed to get parent directory of executable")
.to_path_buf();
let tessdata_path = exe_dir.join("tessdata");
let c = sidecar.env("TESSDATA_PREFIX", tessdata_path).args(&args);

let (_, child) = c.spawn().map_err(|e| e.to_string())?;

debug!("Spawned sidecar with args: {:?}", args);

return Ok(child);
}

let (_, child) = sidecar.args(&args).spawn().map_err(|e| e.to_string())?;

debug!("Spawned sidecar with args: {:?}", args);
Expand Down
4 changes: 3 additions & 1 deletion examples/apps/screenpipe-app-tauri/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@
"connect-src": "ipc: http://ipc.localhost https://api.openai.com http://localhost:3030 http://127.0.0.1:11434 http://localhost:11434 https://api.github.com https://github.com https://*.githubusercontent.com https://*.github.com",
"font-src": [
"https://fonts.gstatic.com",
"tauri://localhost"
"tauri://localhost",
"http://tauri.localhost"

],
"media-src": "'self' mediadevices:",
"img-src": "'self' asset: http://asset.localhost blob: data: https://*.githubusercontent.com https://*.github.com https://github.com https://*.s3.amazonaws.com",
Expand Down

0 comments on commit 5a6ae97

Please sign in to comment.