diff --git a/README.md b/README.md index fa9490d..e5fdc37 100644 --- a/README.md +++ b/README.md @@ -153,6 +153,23 @@ Configure webhooks to receive alerts or reports in your team chat apps. Built-in utility to provide the agent with the current system time, ensuring accurate handling of relative time requests. - **Usage**: "What's the date today?" or "Remind me to check the logs next Monday." +## Docker Support + +### Chinese Font Issues in Screenshots +When running AutoClaw inside a Docker container (especially Alpine or Debian Slim), screenshots of Chinese websites may display text as square boxes ("tofu") due to missing fonts. + +**Solution:** Install CJK (Chinese/Japanese/Korean) fonts in your container. + +**For Debian/Ubuntu:** +```bash +apt-get update && apt-get install -y fonts-noto-cjk fonts-wqy-zenhei +``` + +**For Alpine Linux:** +```bash +apk add font-noto-cjk +``` + ## License MIT diff --git a/src/tools/screenshot.ts b/src/tools/screenshot.ts index 93efda8..208ca83 100644 --- a/src/tools/screenshot.ts +++ b/src/tools/screenshot.ts @@ -64,6 +64,9 @@ export const ScreenshotTool: ToolModule = { await page.goto(args.url, { waitUntil: 'networkidle', timeout: 30000 }); // Inject CSS to force common Chinese fonts + // Note: For Docker environments (Alpine/Debian), ensure fonts are installed. + // Alpine: apk add font-noto-cjk + // Debian/Ubuntu: apt-get install fonts-noto-cjk fonts-wqy-zenhei await page.addStyleTag({ content: ` body, h1, h2, h3, h4, h5, h6, p, span, div, li, a, button, input, textarea {