From f8ac39c7b5d0bfdeeb7e25400f58f558d8488413 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 28 Mar 2026 08:08:51 +0000 Subject: [PATCH 1/2] Initial plan From 860cab0de033a8627b26330a51ce8be327072d80 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 28 Mar 2026 08:36:22 +0000 Subject: [PATCH 2/2] Fix translation font size: CJK height correction and font size averaging Agent-Logs-Url: https://github.com/Freeesia/WindowTranslator/sessions/3b923edd-4d46-425a-b346-5e5e81f7a59a Co-authored-by: Freeesia <9002657+Freeesia@users.noreply.github.com> --- .../Modules/Ocr/OcrBufferFilter.cs | 2 +- .../Modules/Ocr/WindowsMediaOcr.cs | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/WindowTranslator/Modules/Ocr/OcrBufferFilter.cs b/WindowTranslator/Modules/Ocr/OcrBufferFilter.cs index ea71a6b2..5487a30d 100644 --- a/WindowTranslator/Modules/Ocr/OcrBufferFilter.cs +++ b/WindowTranslator/Modules/Ocr/OcrBufferFilter.cs @@ -69,7 +69,7 @@ public async IAsyncEnumerable ExecutePreTranslate(IAsyncEnumerable + /// CJK文字(日本語・中国語・韓国語等)が含まれているかを判定する + /// + private static bool ContainsCjk(string text) + { + foreach (var c in text) + { + // 平仮名・片仮名・CJK統合漢字・ハングル音節・CJK互換漢字 + if ((c >= '\u3040' && c <= '\u9FFF') || + (c >= '\uAC00' && c <= '\uD7AF') || + (c >= '\uF900' && c <= '\uFAFF')) + { + return true; + } + } + return false; + } + private static bool IsAllSameChar(string text) { ReadOnlySpan chars = text;