From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.devel Subject: Re: Stipples support in MS-Windows port Date: Sun, 26 May 2024 15:09:58 +0700 Message-ID: References: <87a5l49a53.fsf@yahoo.com> <87seyw7udp.fsf@yahoo.com> <87wmo0zzni.fsf@yahoo.com> <86r0e83gez.fsf@gnu.org> <861q661vgf.fsf@gmail.com> <86le4dvxx9.fsf@gmail.com> <87frulynby.fsf@yahoo.com> <86zfslctt8.fsf@gmail.com> <86r0dwag4n.fsf@gnu.org> <86r0dww9ne.fsf@gmail.com> <86le43x6ss.fsf@gmail.com> <86o78z8jw2.fsf@gnu.org> <86o78yr45t.fsf@gmail.com> <86h6em1hih.fsf@gnu.org> <86cyp9h0xq.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7417"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , luangruo@yahoo.com, emacs-devel@gnu.org To: "Elijah G." Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 26 10:10:39 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sB8xj-0001fJ-Bt for ged-emacs-devel@m.gmane-mx.org; Sun, 26 May 2024 10:10:39 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sB8xL-0007Vm-39; Sun, 26 May 2024 04:10:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sB8xK-0007Ve-5M for emacs-devel@gnu.org; Sun, 26 May 2024 04:10:14 -0400 Original-Received: from mail-vk1-xa36.google.com ([2607:f8b0:4864:20::a36]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sB8xI-00083J-Hn; Sun, 26 May 2024 04:10:13 -0400 Original-Received: by mail-vk1-xa36.google.com with SMTP id 71dfb90a1353d-4e4effccc19so770798e0c.1; Sun, 26 May 2024 01:10:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716711010; x=1717315810; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=WeZwb777VSI1t0f7QBsH1VXTDcO+jMjC6f6E0PLv5lg=; b=k1c3ik8OuDhiNpgxp6/QBbqpywPY2dOXSQ04FPbq8lzlN9YGGv5iPQohW3k9VbGgRD HXPErObDtU9W8JhgP3mlbLJAb8ky1p6O2nVIt9vCnQp7XPv0v0TbdVS8ujf5eMDG7ZPI oFAPlUqF2TF66+fcfPWr4Rs1zFg1yD6x3vRdannI4SsQrFTCuamM9xQ7sjqxWcpuY02G 6qBpCk05h0pIuzNjPLf+ftVlcle0IWJCNvELeSIJsZFZGsjgyQaG6rCe9u/8P+E0bhOH dyxpv44jkSNCAALiHBulGS06aSZybw4VpHvhyc5TIrMr5w48iJkIYb6EdyHDIR3sKmS/ HjSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716711010; x=1717315810; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WeZwb777VSI1t0f7QBsH1VXTDcO+jMjC6f6E0PLv5lg=; b=fS27OHL/EG+cWdhCnBMLzgkwE80QSjZOboF0bFEPhBFPDHccxKrpf8wetCGksVmWzm V+PSiow22az8Mmy6sR4SBtOaMFIRbAt5JdBK+YjB7Lu5qSIpU3QP9Kux+4ofSQ2R/yC5 I/IxFOc/WY2sDCyPmguF1kHSi3S3CJY/yF7TntGOYceAqkWufl3DDyr8Yj61WgXa62nQ NFFkY0UEm3Pnuuu4hRSi6t9nII/t8i/ZmsumaZOk+IH4EeZGPCl8TfmLuwsBB+FQ4Tt5 IDOIYroZ49mPnpa1VKOmqSXDxUojv++eRhEjvv4wTVoc8uGpylSio5K9ydtrMtB1S869 76XA== X-Forwarded-Encrypted: i=1; AJvYcCVQAT//oEZxKPlTGwqwtKPx0AKUaEilXyTM3sU4R9Ww/FEnzI2Du+j+OMLdrqggd4jeMAPhI0l+rSsFRtDzcHEO+4Nr X-Gm-Message-State: AOJu0Yx21ZRUxjdvNfJNEeRBTgYB/scCbj0d9p9yy5eAjvEskX0ZwS3D 969ejjB40hkFEHMsRSkmTkX9GGmbMtjbW6zPiP7OxnUPOJqrsfCo28iRysCNhmvOklXSapH9UJJ aSRF4ZrI/T4V8W6ok70avf0384D8= X-Google-Smtp-Source: AGHT+IHju6eVR2dVp5AC+itv+yHSofnIO3NadTItj4+qxrPRvFCDYMdJa706dJtOd6jv4rJdMe3abFP5GsPPGB4bIuc= X-Received: by 2002:a67:ea9a:0:b0:480:77c8:8dae with SMTP id ada2fe7eead31-48a3851f45emr6016665137.6.1716711010437; Sun, 26 May 2024 01:10:10 -0700 (PDT) In-Reply-To: <86cyp9h0xq.fsf@gmail.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::a36; envelope-from=yurivkhan@gmail.com; helo=mail-vk1-xa36.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:319580 Archived-At: On Sun, 26 May 2024 at 07:28, Elijah G. wrote: > >> + /* BUG: stipple bitmap has the inverted colors, inverting > >> + those 2 functions color must fix this. */ > > > > Can we fix this before installing, please? If there are problems with > > inverting the colors that you are unsure how to fix, please describe > > those problems in detail, so that others could provide advice or code. > > I would like fix it, but I don't have a clear answer as to why this > problem happens, I just left the notice there as a temp solution in case > someone comes up with a better solution. The documentation for CreatePatternBrush[1] clearly documents the behavior: [1]: https://learn.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-c= reatepatternbrush A brush created by using a monochrome (1 bit per pixel) bitmap has the text and background colors of the device context to which it is drawn. Pixels represented by a 0 bit are drawn with the current text color; pixels represented by a 1 bit are drawn with the current background color. If swapping the background and foreground colors to account for that mapping is not satisfactory for you, you could invert the bitmap before creating the brush. The steps to do that would be, if I have not completely forgotten the GDI A= PI: 1. Use CreateCompatibleDC to create a memory DC. 2. Select the stipple bitmap into this memory DC using SelectObject. 3. Call InvertRect on that DC, passing (0, 0)=E2=80=93(w, h) as the target = rectangle. 4. DeleteDC the memory DC. You should be able to do that once after converting from Emacs format.